asp.net导出txt文件的时候如何换行
DimreturnValueAsString="asdfasd\r\nasdfasdf"Response.Clear()Response.Buffer=TrueRespo...
Dim returnValue As String = "asdfasd \r\n asdfasdf"
Response.Clear()
Response.Buffer = True
Response.Charset = "GB2312"
Response.ContentEncoding = System.Text.Encoding.UTF8
Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("TRANS.TXT"))
Response.ContentType = "text/plain"
Me.EnableViewState = False
Dim myCItrad As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("ZH-CN", True)
Dim oStringWriter As StringWriter = New StringWriter(myCItrad)
Response.Write(returnValue.ToString())
Response.Flush()
Response.End()
发现\r\n没有用,请问这个要怎样才能换行谢谢
俺知道了 加Environment.NewLine 展开
Response.Clear()
Response.Buffer = True
Response.Charset = "GB2312"
Response.ContentEncoding = System.Text.Encoding.UTF8
Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("TRANS.TXT"))
Response.ContentType = "text/plain"
Me.EnableViewState = False
Dim myCItrad As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("ZH-CN", True)
Dim oStringWriter As StringWriter = New StringWriter(myCItrad)
Response.Write(returnValue.ToString())
Response.Flush()
Response.End()
发现\r\n没有用,请问这个要怎样才能换行谢谢
俺知道了 加Environment.NewLine 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询