Exemplo n.º 1
0
    // 校验Item 的account,password和secondpwd字段是否为空
    static private bool _check_empty_and_fetch(Transform trObj, out userdata.AccountInfo info)
    {
        info.name      = "";
        info.password  = "";
        info.secondpwd = "";
        info.flag      = -9999;
        info.item      = trObj;

        info.name = _get_field_text(trObj, "account");
        if (info.name == "")
        {
            return(false);
        }

        info.password = _get_field_text(trObj, "password");
        if (info.password == "")
        {
            return(false);
        }

        info.secondpwd = _get_field_text(trObj, "secondpwd");
        if (info.secondpwd == "")
        {
            return(false);
        }

        string flag = _get_field_text(trObj, "code");

        if (flag != "")
        {
            info.flag = int.Parse(flag);
        }

        return(true);
    }
Exemplo n.º 2
0
 private void _set_item_info(GameObject objItem, userdata.AccountInfo info)
 {
     _set_toggle_status(objItem, "Toggle", false);
     _set_field_info(objItem, "account", info.name);
     _set_field_info(objItem, "password", info.password);
     _set_field_info(objItem, "secondpwd", info.secondpwd);
     _set_field_info(objItem, "status", _get_status(info.flag));
     _set_field_info(objItem, "code", string.Format("{0}", info.flag));
 }
Exemplo n.º 3
0
    static private bool _fetch_user_money(userdata.AccountInfo info)
    {
        Debug.Log("_fetch_user_money account = " + info.name);

        // 请求页面
        send_log(string.Format("用户[{0}]开始登录", info.name));
        string          url      = "http://www.sjhy2016.com";
        CookieContainer m_Cookie = new CookieContainer();
        HttpWebRequest  request  = (HttpWebRequest)WebRequest.Create(url);

        request.Method      = "GET";
        request.ContentType = "text/html;charset=UTF-8";

        request.CookieContainer = m_Cookie;
        HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
        Stream          myResponseStream = response.GetResponseStream();
        StreamReader    myStreamReader   = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
        string          retString        = myStreamReader.ReadToEnd();

        myStreamReader.Close();
        myResponseStream.Close();

        Debug.Log("ret text = " + retString);

        // 解析html文本
        HtmlDocument doc = new HtmlDocument();

        Debug.Log("new xml ok");
        doc.LoadHtml(retString);

        Debug.Log("load xml ok");
        HtmlNode node__VIEWSTATE = doc.DocumentNode.SelectSingleNode("//input[@id='__VIEWSTATE']");
        string   __VIEWSTATE     = node__VIEWSTATE.GetAttributeValue("value", "");

        Debug.Log("__VIEWSTATE = " + __VIEWSTATE);
        //send_log(info.name + ": __VIEWSTATE = " + __VIEWSTATE);

        HtmlNode node__EVENTVALIDATION = doc.DocumentNode.SelectSingleNode("//input[@id='__EVENTVALIDATION']");
        string   __EVENTVALIDATION     = node__EVENTVALIDATION.GetAttributeValue("value", "");

        Debug.Log("__EVENTVALIDATION = " + __EVENTVALIDATION);
        //send_log(info.name + ": __EVENTVALIDATION = " + __EVENTVALIDATION);

        // 正常结束
        info.flag = 0;

        // 更新状态
        send_info(info);

        return(true);
    }
Exemplo n.º 4
0
 static private void _update_status(userdata.AccountInfo info)
 {
     button_event._set_items_status(info.item.transform, info.flag);
 }
Exemplo n.º 5
0
 static public void send_info(userdata.AccountInfo info)
 {
     userdata.set_info(info);
     userdata.set_event(userdata.UserEvent.UEVT_STATUS);
 }