Exemplo n.º 1
0
 public static string GetServerIP()
 {
     try
     {
         string empty = string.Empty;
         empty = HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
         if (empty == null || empty == string.Empty || !FPUtils.IsIP(empty))
         {
             return("0.0.0.0");
         }
         if (empty == "127.0.0.1" || empty == "0.0.0.0")
         {
             empty = FPUtils.GetIntranetIp();
         }
         return(empty);
     }
     catch
     {
         return("0.0.0.0");
     }
 }
Exemplo n.º 2
0
 private void AddSeoInfo(string Seokeywords, string Seodescription)
 {
     string[] array = FPArray.SplitString(meta, "\r\n");
     meta = "";
     string[] array2 = array;
     foreach (string text in array2)
     {
         if (text.ToLower().IndexOf("name=\"keywords\"") > 0 && Seokeywords != null && Seokeywords.Trim() != "")
         {
             meta = meta + "<meta name=\"keywords\" content=\"" + FPUtils.RemoveHtml(Seokeywords + "," + siteinfo.keywords).Replace("\"", " ") + "\" />\r\n";
         }
         else if (text.ToLower().IndexOf("name=\"description\"") > 0 && Seodescription != null && Seodescription.Trim() != "")
         {
             meta = meta + "<meta name=\"description\" content=\"" + FPUtils.RemoveHtml(siteinfo.description + "," + Seodescription).Replace("\"", " ") + "\" />\r\n";
         }
         else
         {
             meta = meta + text + "\r\n";
         }
     }
 }
Exemplo n.º 3
0
        // Token: 0x060000A5 RID: 165 RVA: 0x00009708 File Offset: 0x00007908
        public static string GetServerIP()
        {
            string result;

            try
            {
                string text = string.Empty;
                text = HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
                if (text == null || text == string.Empty || !FPUtils.IsIP(text))
                {
                    result = "0.0.0.0";
                }
                else
                {
                    result = text;
                }
            }
            catch
            {
                result = "0.0.0.0";
            }
            return(result);
        }
Exemplo n.º 4
0
        // Token: 0x06000055 RID: 85 RVA: 0x000038E8 File Offset: 0x00001AE8
        public static SiteConfig GetSiteInfo(string sitepath)
        {
            SiteConfig siteConfig = FPCache.Get <SiteConfig>("FP_SITECONFIG_" + sitepath);

            lock (SiteConfigs.lockHelper)
            {
                if (siteConfig == null)
                {
                    string mapPath;
                    if (sitepath == "")
                    {
                        mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "site.config");
                    }
                    else if (File.Exists(FPUtils.GetMapPath(WebConfig.WebPath + "sites/" + sitepath + "/site.config")))
                    {
                        mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "sites/" + sitepath + "/site.config");
                    }
                    else if (File.Exists(FPUtils.GetMapPath(WebConfig.WebPath + sitepath + "/site.config")))
                    {
                        mapPath = FPUtils.GetMapPath(WebConfig.WebPath + sitepath + "/site.config");
                    }
                    else
                    {
                        mapPath = FPUtils.GetMapPath(WebConfig.WebPath + "site.config");
                    }
                    if (!File.Exists(mapPath))
                    {
                        FPSerializer.Save <SiteConfig>(mapPath);
                    }
                    FPCache.Insert("FP_SITECONFIG_" + sitepath, SiteConfigs.LoadConfig(mapPath), mapPath);
                    siteConfig = FPCache.Get <SiteConfig>("FP_SITECONFIG_" + sitepath);
                }
            }
            siteConfig.sitepath = sitepath;
            return(siteConfig);
        }
Exemplo n.º 5
0
        // Token: 0x06000092 RID: 146 RVA: 0x00008E84 File Offset: 0x00007084
        public static DateTime GetDateTime(string strName)
        {
            string dateTime = FPUtils.GetDateTime(FPRequest.GetString(strName));

            return(Convert.ToDateTime(dateTime));
        }
Exemplo n.º 6
0
 // Token: 0x0600008F RID: 143 RVA: 0x00008DFC File Offset: 0x00006FFC
 public static int GetFormInt(string strName, int defValue)
 {
     return(FPUtils.StrToInt(HttpContext.Current.Request.Form[strName], defValue));
 }
Exemplo n.º 7
0
 public static string echo(string obj, string format)
 {
     return(FPUtils.FormatDateTime(obj, format));
 }
Exemplo n.º 8
0
 // Token: 0x0600007B RID: 123 RVA: 0x0000870C File Offset: 0x0000690C
 protected bool ischecked(string cstr, string values)
 {
     return(FPUtils.InArray(cstr, values));
 }
Exemplo n.º 9
0
 // Token: 0x060000C6 RID: 198 RVA: 0x0000A598 File Offset: 0x00008798
 public static bool InArray(string str, string stringArray)
 {
     return(FPUtils.InArray(str, stringArray, ","));
 }
Exemplo n.º 10
0
 public static string echo(DateTime?obj)
 {
     return(FPUtils.FormatDateTime(obj));
 }
Exemplo n.º 11
0
        public static DateTime GetDateTime(string strName)
        {
            string @string = GetString(strName);

            @string = ((strName.ToLower() == "startdate") ? FPUtils.FormatDateTime(@string, "yyyy-MM-dd 00:00:00") : ((!(strName.ToLower() == "enddate")) ? FPUtils.FormatDateTime(@string) : FPUtils.FormatDateTime(@string, "yyyy-MM-dd 23:59:59")));
            return(FPUtils.StrToDateTime(@string));
        }
Exemplo n.º 12
0
 public static DateTime?GetDateTime2(string strName, string format)
 {
     return(FPUtils.StrToDateTime2(FPUtils.FormatDateTime(GetString(strName), format)));
 }
Exemplo n.º 13
0
 // Token: 0x060000D8 RID: 216 RVA: 0x0000AAA8 File Offset: 0x00008CA8
 public static float StrToFloat(object strValue)
 {
     return(FPUtils.StrToFloat(strValue, 0f));
 }
Exemplo n.º 14
0
 // Token: 0x060000DA RID: 218 RVA: 0x0000AB2C File Offset: 0x00008D2C
 public static decimal StrToDecimal(object strValue)
 {
     return(FPUtils.StrToDecimal(strValue, 0.00m));
 }
Exemplo n.º 15
0
 // Token: 0x060000D6 RID: 214 RVA: 0x0000A9E0 File Offset: 0x00008BE0
 public static int StrToInt(object Expression)
 {
     return(FPUtils.StrToInt(Expression, 0));
 }
Exemplo n.º 16
0
        // Token: 0x060000CF RID: 207 RVA: 0x0000A820 File Offset: 0x00008A20
        public static string GetDate(DateTime datetime, string replacestr)
        {
            string datetimestr = datetime.ToString();

            return(FPUtils.GetDate(datetimestr, replacestr));
        }
Exemplo n.º 17
0
 // Token: 0x060000C7 RID: 199 RVA: 0x0000A5B8 File Offset: 0x000087B8
 public static bool InArray(int id, string stringArray, string strsplit)
 {
     return(FPUtils.InArray(id.ToString(), stringArray, strsplit));
 }
Exemplo n.º 18
0
        // Token: 0x06000093 RID: 147 RVA: 0x00008EA8 File Offset: 0x000070A8
        public static DateTime GetDateTime()
        {
            string dateTime = FPUtils.GetDateTime();

            return(Convert.ToDateTime(dateTime));
        }
Exemplo n.º 19
0
 public static decimal GetFormDecimal(string strName, decimal defValue)
 {
     return(FPUtils.StrToDecimal(HttpContext.Current.Request.Form[strName], defValue));
 }
Exemplo n.º 20
0
 // Token: 0x060000DC RID: 220 RVA: 0x0000ABB4 File Offset: 0x00008DB4
 public static double StrToDouble(object strValue)
 {
     return(FPUtils.StrToDouble(strValue, 0.0));
 }
Exemplo n.º 21
0
 public static string echo(DateTime?obj, string fmstr)
 {
     return(FPUtils.FormatDateTime(obj, fmstr));
 }
Exemplo n.º 22
0
        public static DateTime?GetDateTime2(string strName)
        {
            string @string = GetString(strName);

            if (string.IsNullOrEmpty(@string))
            {
                return(null);
            }
            @string = ((strName.ToLower() == "startdate") ? FPUtils.FormatDateTime(@string, "yyyy-MM-dd 00:00:00") : ((!(strName.ToLower() == "enddate")) ? FPUtils.FormatDateTime(@string) : FPUtils.FormatDateTime(@string, "yyyy-MM-dd 23:59:59")));
            return(FPUtils.StrToDateTime2(@string));
        }
Exemplo n.º 23
0
 // Token: 0x060000BE RID: 190 RVA: 0x0000A344 File Offset: 0x00008544
 public static string[] SplitString(string strContent)
 {
     return(FPUtils.SplitString(strContent, ","));
 }
Exemplo n.º 24
0
 public static float GetFormFloat(string strName, float defValue)
 {
     return(FPUtils.StrToFloat(HttpContext.Current.Request.Form[strName], defValue));
 }
Exemplo n.º 25
0
 // Token: 0x060000C1 RID: 193 RVA: 0x0000A400 File Offset: 0x00008600
 public static int[] SplitInt(string strContent)
 {
     return(FPUtils.SplitInt(strContent, ","));
 }
Exemplo n.º 26
0
 public static double GetFormDouble(string strName, double defValue)
 {
     return(FPUtils.StrToDouble(HttpContext.Current.Request.Form[strName], defValue));
 }
Exemplo n.º 27
0
        // Token: 0x06000077 RID: 119 RVA: 0x0000853C File Offset: 0x0000673C
        private void AddSeoInfo(string Seokeywords, string Seodescription)
        {
            string[] array = FPUtils.SplitString(this.meta, "\r\n");
            this.meta = "";
            string[] array2 = array;
            int      i      = 0;

            while (i < array2.Length)
            {
                string text = array2[i];
                if (text.ToLower().IndexOf("name=\"keywords\"") <= 0)
                {
                    goto IL_B5;
                }
                if (Seokeywords == null || !(Seokeywords.Trim() != ""))
                {
                    goto IL_B5;
                }
                this.meta = this.meta + "<meta name=\"keywords\" content=\"" + FPUtils.RemoveHtml(Seokeywords + "," + this.siteconfig.keywords).Replace("\"", " ") + "\" />\r\n";
IL_153:
                i++;
                continue;
IL_B5:
                if (text.ToLower().IndexOf("name=\"description\"") > 0)
                {
                    if (Seodescription != null && Seodescription.Trim() != "")
                    {
                        this.meta = this.meta + "<meta name=\"description\" content=\"" + FPUtils.RemoveHtml(this.siteconfig.description + "," + Seodescription).Replace("\"", " ") + "\" />\r\n";
                        goto IL_153;
                    }
                }
                this.meta = this.meta + text + "\r\n";
                goto IL_153;
            }
        }
Exemplo n.º 28
0
 public static void WriteDown(string filePath, string filename)
 {
     HttpContext.Current.Response.Buffer = true;
     HttpContext.Current.Response.Clear();
     HttpContext.Current.Response.ContentType = GetResponseContentType(Path.GetExtension(filePath));
     HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + FPUtils.UrlEncode(filename));
     HttpContext.Current.Response.WriteFile(filePath);
     HttpContext.Current.Response.Flush();
     HttpContext.Current.Response.End();
 }
Exemplo n.º 29
0
 // Token: 0x0600007A RID: 122 RVA: 0x000086F0 File Offset: 0x000068F0
 protected bool ischecked(int cid, string values)
 {
     return(FPUtils.InArray(cid, values));
 }