Esempio n. 1
0
 private void CreateIndexHtml(string lang, string aspx_filename, string catalogue)
 {
     if (System.IO.File.Exists(Utils.GetMapPath(this.config.webpath + aspx_filename.Substring(0, aspx_filename.IndexOf(".aspx") + 5))))
     {
         string str1    = this.config.webpath + aspx_filename.Replace("^", "&");
         string strPath = this.config.webpath + catalogue;
         if (strPath.IndexOf(".") < 0)
         {
             strPath = strPath + "index." + this.config.staticextension;
         }
         string path = HttpContext.Current.Server.MapPath(strPath.Substring(0, strPath.LastIndexOf("/")));
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         string str2 = HttpContext.Current.Request.Url.Authority;
         Rain.Model.channel_site model = this.objchannel_site.GetModel(lang);
         if (model != null && !string.IsNullOrEmpty(model.domain))
         {
             str2 = model.domain;
         }
         string end = new StreamReader(WebRequest.Create("http://" + str2 + str1).GetResponse().GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();
         using (StreamWriter streamWriter = new StreamWriter(Utils.GetMapPath(strPath), false, Encoding.UTF8))
         {
             streamWriter.WriteLine(end);
             streamWriter.Flush();
             streamWriter.Close();
         }
     }
     else
     {
         HttpContext.Current.Response.Write("1");
     }
 }
Esempio n. 2
0
 public BaseMasterPage()
 {
     if (this.config.webstatus == 0)
     {
         HttpContext.Current.Response.Redirect(this.linkurl("error", (object)("?msg=" + Utils.UrlEncode(this.config.webclosereason))));
     }
     else
     {
         this.site = this.GetSiteModel();
         this.ShowPage();
     }
 }