部分代码如下:
==============================================================================
.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();
==============================================================================
解决方案 »
- 如何让select里的文本居中IE,firefox
- 怎么为windows 2008 r2添加vfp odbc驱动?急!在线等!
- 如何让Attributes.Add在postBack后依然存在
- .net项目中后台数据库现在用的是mssql 2k,05还是08最多?
- 我想用VS开发一个小型论坛,请问用什么控件比较好?
- asp.net中显示图片问题
- 图片滚动的问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 最新文件上传下载问题
- ADO.NET得问题
- Winxp编写的程序,服务器win2000,datagrid传值发生了变化!
- 在WIN98下可不可以直接装.NET框架做ASP.NET
- 就30分了,谁能帮我翻译[源代码]ASP.NET中实现Web打印的方案 成vb.net
改为
StreamWriter sw = new StreamWriter(File.CreateText(Server.MapPath(strPath),Encoding.GetEncoding("GB18030"));
txtFileContent.Text = sr.ReadToEnd();
sr.Close();
这个
行 70: strPath = "/" + strPath;
行 71: StreamWriter sw = new StreamWriter(File.CreateText(Server.MapPath(strPath),Encoding.GetEncoding("GB18030")));
行 72: sw.Write(txtFileContent.Text);
行 73: sw.Close();
行 70: strPath = "/" + strPath;
行 71: StreamWriter sw = new StreamWriter(File.CreateText(Server.MapPath(strPath)),System.Text.Encoding.GetEncoding("GB18030"));
行 72: sw.Write(txtFileContent.Text);
行 73: sw.Close();