コード例 #1
0
        public Dictionary <CookieCollection, string> Logon()
        {
            string id     = "";
            string userid = "";
            string pwd    = "";
            string path   = "";

            try
            {
                id     = ConfigurationManager.AppSettings["id"].ToString();
                path   = ConfigurationManager.AppSettings["path"].ToString();
                userid = du.EnDEUser(ConfigurationManager.AppSettings["userid"].ToString(), id + path, false);
                pwd    = du.EnDEUser(ConfigurationManager.AppSettings["pwd"].ToString(), id + path, false);
            }
            catch (Exception)
            {
                Invoke(new Action(() =>
                {
                    hm.AppendMsg(rtxtMsg, Color.Red, "读取配置文件错误,请重新设置你的账户信息!", true);
                    return;
                }));
            }
            string url_index = "http://emuch.net/bbs/logging.php?action=login"
                               + "&cookietime=31536000"
                               + "&formhash=eb4b777d"
                               + "&loginsubmit=%C2%BB%C3%A1%C3%94%C2%B1%C2%B5%C3%87%C3%82%C2%BC"
                               + "&password="******"&referer=http%3A%2F%2Femuch.net%2Fbbs%2Findex.php%3Femobile%3D1"
                               + "&username="******"get", "", "application/x-www-form-urlencoded", "gbk");
            return(dic_index);
        }
コード例 #2
0
        private bool SaveUser(string userid, string pwd, string id, string path)
        {
            string type = id + path;

            try
            {
                string newuserid = du.EnDEUser(userid, type, true);//加密
                string newpwd    = du.EnDEUser(pwd, type, true);
                du.SetValue("userid", newuserid);
                du.SetValue("pwd", newpwd);
                du.SetValue("id", id);
                du.SetValue("path", path);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }