ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 简单C#生成静态及相关读取模板文件

简单C#生成静态及相关读取模板文件

原创 Linux操作系统 作者:iDotNetSpace 时间:2010-02-24 11:45:12 0 删除 编辑
        string gh = HttpRuntime.AppDomainAppPath;
        StreamReader reader 
= new StreamReader(gh+"/33.htm", Encoding.GetEncoding("gb2312"));
        
string html = reader.ReadToEnd();
        html 
= html.Replace("<!--123-->", "好好");
        Response.Write(html);
        StreamWriter sw 
= new StreamWriter(Server.MapPath("311.htm"), false, System.Text.Encoding.GetEncoding("GB2312"));
        sw.WriteLine(html);
        sw.Flush();
        sw.Close();

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-627721/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: c#泛型的使用
请登录后发表评论 登录
全部评论

注册时间:2008-01-04

  • 博文量
    2376
  • 访问量
    5766042