Beispiel #1
0
        public static int GetFormInt(string strName, int defValue)
        {
            string formString = GetFormString(strName);

            if (FPUtils.IsNumericArray(formString))
            {
                return(FPArray.SplitInt(formString, 1)[0]);
            }
            return(FPUtils.StrToInt(formString, defValue));
        }
Beispiel #2
0
 public FPController()
 {
     port = FPArray.SplitInt(domain, ":", 2)[1];
     if (rawurl.IndexOf("/") >= 0)
     {
         if (rawurl.IndexOf("?") >= 0)
         {
             rawpath = rawurl.Substring(0, rawurl.IndexOf("?"));
             rawpath = rawpath.Substring(0, rawpath.LastIndexOf("/")) + "/";
         }
         else
         {
             rawpath = rawurl.Substring(0, rawurl.LastIndexOf("/")) + "/";
         }
     }
     else
     {
         rawpath = webpath;
     }
     cururl  = rawurl.Substring(webpath.Length);
     pageurl = pagename;
     if (cururl.Contains("?"))
     {
         curname = cururl.Substring(0, cururl.IndexOf("?"));
         query   = cururl.Substring(cururl.IndexOf("?") + 1);
         pageurl = pagename + "?" + query;
     }
     else
     {
         curname = cururl;
     }
     if (curname.IndexOf("/") > 0)
     {
         curpath = curname.Substring(0, curname.LastIndexOf("/")) + "/";
     }
     if (curname.IndexOf("/") >= 0)
     {
         sitepath = curname.Substring(0, curname.IndexOf("/"));
     }
     else
     {
         sitepath = WebConfig.SitePath;
     }
     if (sitepath == "sites")
     {
         sitepath = curpath.Substring(curpath.IndexOf("/") + 1).TrimEnd('/');
     }
     if (!Directory.Exists(FPFile.GetMapPath(webpath + sitepath)))
     {
         sitepath = WebConfig.SitePath;
     }
     pagepath  = webpath + sitepath + "/";
     siteinfo  = SiteConfigs.GetSiteInfo(sitepath);
     adminpath = webpath + "admin/";
     plupath   = webpath + "plugins/";
     apppath   = webpath + "app/";
     sitetitle = siteinfo.sitetitle;
     pagetitle = siteinfo.sitetitle;
     CreateSeoInfo(siteinfo.keywords, siteinfo.description, siteinfo.otherhead);
     ispost = FPRequest.IsPost();
     isget  = FPRequest.IsGet();
     isfile = FPRequest.IsPostFile();
     action = FPRequest.GetString("action");
     op     = FPRequest.GetInt("op");
     try
     {
         ua = HttpContext.Current.Request.UserAgent.ToLower();
     }
     catch
     {
     }
     browser = getBrowserName(ua, out isie);
     args    = FPArray.SplitString(Path.GetFileNameWithoutExtension(pagename), "-");
 }