Private Sub ExportTXT()
Dim str_File As String = "<br/>"
Dim strconn As String = ConfigurationSettings.AppSettings("connectingstring")
Dim cn As SqlConnection = New SqlConnection(strconn)
Dim s_temp As String = "select e_mail from gorder"
Dim SaveFileName As String = "e_mail"
SaveFileName = SaveFileName + ".txt"
Try
cn.Open()
Dim cmtemp As SqlCommand = New SqlCommand(s_temp, cn)
Dim drtemp As SqlDataReader = cmtemp.ExecuteReader()
While (drtemp.Read())
str_File = str_File + drtemp("e_mail").ToString + "<br/>"
End While
If (File.Exists("f:\\" + SaveFileName)) Then
Label5.Text = "该文件已经存在!已经被删除,请重新再次导出即可"
File.Delete("f:\\" + SaveFileName)
d1.Visible = True
Return
Else
Dim sw As StreamWriter = File.CreateText("f:\\" + SaveFileName)
sw.WriteLine(str_File)
sw.Close()
Label5.Text = "写入文件成功!"
d1.Visible = True
End If
Catch ex As Exception
Label1.Visible = True
Label5.Text = ex.Message
End Try
cn.Close()
End Sub
我要写进记事本中的数据是这样的liii@126.com, liii@126.com, liii@126.com, 就是一行控制显示4到5个邮箱,以逗号分开,请问怎么做啊,还有我str_File = str_File + drtemp("e_mail").ToString + "<br/>" 写这样的"<br/>"怎么写进去之后是直接显示成<br/>啊
我要的换行啊!