阅读背景:

#怎么读写文件和获取文件的扩展名

来源:互联网 
protected void Write_Txt(string FileName, string Content)
       {
           Encoding code = Encoding.GetEncoding("gb2312");
           string htmlfilename = HttpContext.Current.Server.MapPath("Precious\" + FileName + ".txt"); //保存文件的路径
           string str = Content;
           StreamWriter sw = null;
           {
               try
               {
                   sw = new StreamWriter(htmlfilename, false, code);
                   sw.Write(str);
                   sw.Flush();
               }
               catch { }
           }
           sw.Close();
           sw.Dispose();
 
      }protected void Write_Txt(string FileName, strin



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: