◆◇◆◇◆为什么 StreamWriter.Write 不能写中文?◆◇◆◇◆
wanbo 2005-01-27 04:43:47 部分代码如下:
==============================================================================
.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();
==============================================================================