请教各位大侠
  我写了一个Web 的应用程序
  在VS.net上调试的时候Global.asax文件是可以执行的
  可在编译在IIS上发布后就好像 没有起到什么作用了,不知道是什么原因  也按照网上 的方法说是先把GLOBAL剪切后编译完在加入,这个不行
  也把根目录下的PrecompiledApp.config 文件删除 了,也不行  不知道各位有遇过这样的问题没?怎么解决的 ,请指教!!!!

解决方案 »

  1.   

    可以都放到Global.asax里面,去掉cs代码
      

  2.   

     void Application_Start(object sender, EventArgs e) 
        {
            string path = "C://UnitedwinASPWeb//Test//Tmp_Weather.html";       
                    System.Net.WebRequest Request = System.Net.WebRequest.Create("http://m.weather.com.cn/data/101190401.html");
                    System.Net.WebResponse Reponse = Request.GetResponse();
                    System.IO.StreamReader reader = new System.IO.StreamReader(Reponse.GetResponseStream(), System.Text.Encoding.UTF8);
                    string strs = reader.ReadToEnd();                //strs.ToString();                reader.Close();                //string str = Microsoft.VisualBasic.Strings.StrConv(strs, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0);
                    if (!System.IO.File.Exists(path))
                    {
                        System.IO.File.Create(path);                }       
            
           StreamWriter W = new StreamWriter(path, false);
           W.WriteLine("aa");
           W.Close();
           
               }
        
    以上为GLOBAL中要做的操作! 请指教
      

  3.   

     string path = "C://UnitedwinASPWeb//Test//Tmp_Weather.html";
    ???????????????????????????本地路径??