当前位置: 代码迷 >> ASP.NET >> asp.net生成静态页出现的有关问题。
  详细解决方案

asp.net生成静态页出现的有关问题。

热度:3119   发布时间:2013-02-25 00:00:00.0
asp.net生成静态页出现的问题。高手请进。
Conn的类:
using   System;
using   System.Text;
using   System.Web;
using   System.IO;
namespace   myservers
{
        ///       <summary>      
        ///       Conn       的摘要说明。      
        ///       </summary>      
        public   class   Conn
        {
                public   Conn()
                {
                        //      
                        //       TODO:       在此处添加构造函数逻辑      
                        //      
                }

                  public       bool       WriteFile(string       strText,string       strContent)          
            {          
                string       path       =       HttpContext.Current.Server.MapPath( "news/ ");//定义html文件存放路径          
                Encoding       code       =       Encoding.GetEncoding( "gb2312 ");//定义文字编码          
                //       读取模板文件          
                string       temp       =       HttpContext.Current.Server.MapPath( "text ");          
                StreamReader       sr=null;          
                StreamWriter       sw=null;          
                string       str= " ";              
                try          
                {          
                    sr       =       new       StreamReader(temp,       code);          
                    str       =       sr.ReadToEnd();       //       读取文件          
                }          
                catch(Exception       exp)          
  相关解决方案