Common/WebHelper.cs

(开头部分) 23KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using OPMS.Common;
namespace OPMS.Common
{
    using System;
    using System.Collections.Specialized;
    using System.IO;
    using System.IO.Compression;
    using System.Management;
    using System.Net;
    using System.Net.Cache;
    using System.Security;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;
    using System.Xml;

    public class WebHelper
    {
        private static string[] _browserlist = new string[] { "ie", "chrome", "mozilla", "netscape", "firefox", "opera", "konqueror" };
        private static Regex _metaregex = new Regex("<meta([^<]*)charset=([^<]*)[\"']", RegexOptions.Multiline | RegexOptions.IgnoreCase);
        private static string[] _searchenginelist = new string[] { "baidu", "google", "360", "sogou", "bing", "msn", "sohu", "soso", "sina", "163", "yahoo", "jikeu" };

        public static void DeleteCookie(string name)
        {
            HttpCookie cookie = new HttpCookie(name) {
                Expires = DateTime.Now.AddYears(-1)
            };
            HttpContext.Current.Response.AppendCookie(cookie);
        }

        public static string GetBrowserName()
        {
            string browser = HttpContext.Current.Request.Browser.Browser;
            if (string.IsNullOrEmpty(browser))
            {
                return "未知";
            }
            return browser.ToLower();
        }

        public static string GetBrowserType()
        {
            string type = HttpContext.Current.Request.Browser.Type;
            if (string.IsNullOrEmpty(type))
            {
                return "未知";
            }
            return type.ToLower();
        }

        public static string GetBrowserVersion()
        {
            string version = HttpContext.Current.Request.Browser.Version;
            if (string.IsNullOrEmpty(version))
            {
                return "未知";
            }
            return version;
        }

后面还有 613 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。