Example #1
0
 private void wbWorkArea_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     wbWorkArea.Document.InvokeScript("setExecModeForPam");
     wbWorkArea.Document.InvokeScript("setClientSize", new object[] { wbWorkArea.Width.ToString(), wbWorkArea.Height.ToString() });
     if (e.Url.ToString() == PensionAgencyVar.AccessPoint + _AutoLoginUrl)
     {
         autoLoginThread = ThreadAdapter.WhileCircleTask(
             () =>
         {
             if (!isAutoLogined && flash4ajaxReady)
             {
                 this.Invoke(new Action(() =>
                 {
                     Common.DebugLog("----------------------------begin setAutoLogin-------------------");
                     string jsonStr = JsonConvert.SerializeObject(new { Code = PensionAgencyVar.UserCode, Password = PensionAgencyVar.Password });
                     wbWorkArea.Document.InvokeScript("setAutoLogin", new object[] { jsonStr });
                 }));
                 isAutoLogined = true;
             }
         },
             100,
             () =>
         {
             return(isAutoLogined);
         }//flash准备好了则停止
             );
     }
     else if (e.Url.ToString() == PensionAgencyVar.AccessPoint + "/index.htm")
     {
         wbWorkArea.Document.InvokeScript("loadPage", new object[] { "welcome.htm" });
     }
 }
Example #2
0
 private void wbProvinceSum_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     wbProvinceSum.Document.InvokeScript("setExecModeForGov");
     wbProvinceSum.Document.InvokeScript("setClientSize", new object[] { wbProvinceSum.Width.ToString(), wbProvinceSum.Height.ToString() });
     if (e.Url.ToString() == GovVar.AccessOfProvice + _AutoLoginUrl)
     {
         autoLoginForProvinceThread = ThreadAdapter.WhileCircleTask(
             () =>
         {
             if (!isAutoLoginedForProvince && flash4ajaxReadyForProvince)
             {
                 this.Invoke(new Action(() =>
                 {
                     Common.DebugLog("----------------------------begin setAutoLogin for Province-------------------");
                     string jsonStr = JsonConvert.SerializeObject(new { Code = "demo", Password = "******" });
                     wbProvinceSum.Document.InvokeScript("setAutoLogin", new object[] { jsonStr });
                 }));
                 isAutoLoginedForProvince = true;
             }
         },
             100,
             () =>
         {
             return(isAutoLoginedForProvince);
         }//flash准备好了则停止
             );
     }
     else if (e.Url.ToString() == GovVar.AccessOfProvice + "/index.htm")
     {
         wbProvinceSum.Document.InvokeScript("loadPage", new object[] { "welcome.htm" });
     }
 }