代码如下:
Dim MyItem As ListItem
Dim c As String
If LB_2.Items.Count = 0 Then
Response.Write("<script language='javascript'> alert ('至少要选择一个发送对象!');</script>") End If
For Each MyItem In LB_2.Items
tt.Text = MyItem.Text
sqlconn.opendb()
Dim f = "select email from whpyminfo_dep where name_dep='" + tt.Text + "'"
Dim MyCommand_r As New SqlCommand(f, sqlconn.myconnection)
Dim dr As SqlDataReader = MyCommand_r.ExecuteReader()
If dr.Read() Then
mail.Text = dr.GetString(0) If guoguo.Text = "" Then
guoguo.Text = mail.Text
Else
guoguo.Text = guoguo.Text + ";" + mail.Text + ""
End If End If sqlconn.closedb() Next Dim a As String = "mailto:"
Dim b As String = guoguo.Text
'Response.Write(b)
c = a + b
Response.Redirect(c)
End Sub
Dim MyItem As ListItem
Dim c As String
If LB_2.Items.Count = 0 Then
Response.Write("<script language='javascript'> alert ('至少要选择一个发送对象!');</script>") End If
For Each MyItem In LB_2.Items
tt.Text = MyItem.Text
sqlconn.opendb()
Dim f = "select email from whpyminfo_dep where name_dep='" + tt.Text + "'"
Dim MyCommand_r As New SqlCommand(f, sqlconn.myconnection)
Dim dr As SqlDataReader = MyCommand_r.ExecuteReader()
If dr.Read() Then
mail.Text = dr.GetString(0) If guoguo.Text = "" Then
guoguo.Text = mail.Text
Else
guoguo.Text = guoguo.Text + ";" + mail.Text + ""
End If End If sqlconn.closedb() Next Dim a As String = "mailto:"
Dim b As String = guoguo.Text
'Response.Write(b)
c = a + b
Response.Redirect(c)
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货