◆◇◆◇◆为什么 StreamWriter.Write 不能写中文?◆◇◆◇◆
部分代码如下:
==============================================================================
.aspx
==============================================================================
<asp:TextBox ID="txtFileContent" TextMode="MultiLine" BackColor="#dff8ff" Font-Size="9" Font-Name="新宋体" Width="98%" Rows="30" runat="server"/>
==============================================================================
.cs
==============================================================================
string strPath = txtPath.Text;
if(!strPath.StartsWith("/"))
strPath = "/" + strPath;
StreamWriter sw = File.CreateText(Server.MapPath(strPath));
sw.Write(txtFileContent.Text);
sw.Close();
==============================================================================
==============================================================================
.aspx
==============================================================================
<asp:TextBox ID="txtFileContent" TextMode="MultiLine" BackColor="#dff8ff" Font-Size="9" Font-Name="新宋体" Width="98%" Rows="30" runat="server"/>
==============================================================================
.cs
==============================================================================
string strPath = txtPath.Text;
if(!strPath.StartsWith("/"))
strPath = "/" + strPath;
StreamWriter sw = File.CreateText(Server.MapPath(strPath));
sw.Write(txtFileContent.Text);
sw.Close();
==============================================================================
...全文
相关推荐
Stream.Write 与 StreamWriter.Write 的不同
Stream.Write 与 StreamWriter.Write 是我们在向流中写数据时,最常用的方法。下面就详细讲解这两个方法。
C#使用StreamWriter写入文件的方法
主要介绍了C#使用StreamWriter写入文件的方法,涉及C#中StreamWriter类操作文件的相关技巧,需要的朋友可以参考下
C#使用Streamwriter打开文件的方法
主要介绍了C#使用Streamwriter打开文件的方法,涉及C#操作文件的技巧,非常具有实用价值,需要的朋友可以参考下
C#使用StreamWriter和StreamReader读写文件
使用StreamWriter和StreamReader读写文件,StreamWriter和StreamReader都是C#中两个文件操作函数,一个是读文件,一个是写文件,其实掌握它们的用法并不难,而且它们也是相当有用处的,期待打基础的C#爱好者们下载参阅。
Console.Write写大量字符串异常
Console.Write写大量字符串异常处理


