Beispiel #1
0
        private void geckoWebBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            String cUrl = geckoWebBrowser1.Url.AbsoluteUri;

            if (!LOAD_LAST_FLAG)
            {
                if (cUrl.IndexOf("login") > 0)
                {
                    WebJS js = new WebJS(geckoWebBrowser1.Document);
                    js.setFieldValue("user_id", INIConfig.ReadString("System", "UserID"));
                    js.setFieldValue("user_pass", INIConfig.ReadString("System", "UserPass"));
                    LOAD_LAST_FLAG = true;
                }
            }

            if ((LOAD_LAST_FLAG) && (!LOAD_TOKEN_FLAG))
            {
                if (cUrl.IndexOf("index") > 0)
                {
                    WebJS  js        = new WebJS(geckoWebBrowser1.Document);
                    string cUserCode = js.getFieldValue("usercode");
                    ApplicationEvent.setUserCode(cUserCode);
                    // ApplicationEvent.UserInfo.USER_CODE = cUserCode;

                    string cOrgID = js.getFieldValue("orgid");
                    //ApplicationEvent.UserInfo.ORG_ID = cOrgID;

                    string cToken = js.getFieldValue("token");
                    ApplicationEvent.Token = cToken;
                    LOAD_TOKEN_FLAG        = true;
                }
            }
        }