Beispiel #1
0
        public App()
        {
            InitializeComponent();

            MainPage = new MyPrisoners.Client.MainPage();
            MainPage = new AllPage();
        }
        public ActionResult EditPagesConfirm(AllPage alp)
        {
            int id   = (int)Session["id"];
            var find = db.AllPages.Find(id);

            if (db.AllPages.Where(x => x.Id == find.Id) != null)
            {
                find.StrOfAllPage = HttpUtility.HtmlDecode(alp.StrOfAllPage);
            }
            db.SaveChanges();
            Session.Remove("id");
            return(RedirectToAction("SelectPageType"));
        }
Beispiel #3
0
 public async void Login(string username, string password)
 {
     currentPageLoaded = false;
     try
     {
         Invoke((MethodInvoker) delegate {
             currentPageLoaded = false;
             webBrowser1.Url   = new Uri("https://login.taobao.com/member/login.jhtml?style=mini&newMini2=true&css_style=alimama&from=alimama&redirectURL=http://www.alimama.com&full_redirect=true&disableQuickLogin=true");
         });
         await Task.Factory.StartNew(() =>
         {
             while (true)
             {
                 Thread.Sleep(500);
                 if (IsCurrentPageLoaded())
                 {
                     break;
                 }
             }
             Console.WriteLine("loaded!");
             // 此处进入UI
             Invoke((MethodInvoker) delegate
             {
                 HtmlElement loginBox = AllPage.FindElementByClassName(webBrowser1, "login-switch");
                 if (LoginPage.IsQROpen(webBrowser1))
                 {
                     loginBox.InvokeMember("click");
                 }
             });
         });
     }
     catch (InvalidOperationException)
     {
         Thread.Sleep(500);
         Login(username, password);
     }
 }