public InternetExplorerTab(string title, SHDocVw.InternetExplorer ie)
			: base(title)
		{
			_ie = ie;
		}
Exemplo n.º 2
0
        // GET: api/Users
        public IHttpActionResult GetUser(PublicModel publicModel)
        {
            SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();

            ie.Navigate("https://login.taobao.com/member/login.jhtml?redirectURL=https%3A%2F%2Fai.taobao.com%2F%3Fpid%3Dmm_112599953_14918079_77950911");
            ie.Visible = true;

            IHTMLDocument3 doc = (IHTMLDocument3)ie.Document;

            doc.getElementById("TPL_username_1").innerText = "肖梓璇35834616";
            doc.getElementById("TPL_password_1").innerText = "xiao4563515";
            doc.getElementById("J_SubmitStatic").click();


            ie.Navigate("http://i.taobao.com/my_taobao.htm");
            ie.Visible = true;

            ie.Navigate(" https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm?spm=a1z02.1.972272805.d4919663.73d2782d6TTeTm&action=itemlist/BoughtQueryAction&event_submit_do_query=1&tabCode=waitRate");
            ie.Visible = true;
            doc.getElementById("rateOrder").click();
            var ss = doc.documentElement.outerText = "1111";


            var userList = db.User.ToList();
            var data     = Newtonsoft.Json.JsonConvert.SerializeObject(userList);

            return(Json(data));
        }
Exemplo n.º 3
0
 public DkbSession(string user, string password)
 {
     User = user;
     Password = password;
     ie = new SHDocVw.InternetExplorer();
     ie.Visible = true;
 }
Exemplo n.º 4
0
 public object StartMethod(object parent = null, Dictionary<string, object> parameters = null)
 {
     if (!parameters.ContainsKey("Url")) throw new ArgumentNullException("Url");
     KillIExplore();
     System.Diagnostics.Process IE = System.Diagnostics.Process.Start("IExplore.exe", (string)parameters["Url"]);
     System.Threading.Thread.Sleep(5000);
     SHDocVw.ShellWindows shellwindows = new SHDocVw.ShellWindows();
     string filename;
     foreach (SHDocVw.InternetExplorer ie in shellwindows)
     {
         filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
         if (filename.Equals("iexplore") && ie.LocationURL.StartsWith("http://"))
         {
             m_ieBrowser = ie;
             Console.WriteLine("Web Site  : {0}", ie.LocationURL);
             mshtml.IHTMLDocument2 document = m_ieBrowser.Document as mshtml.IHTMLDocument2;
             while (document.readyState != "complete")
             {
                 System.Threading.Thread.Sleep(1000);
             }
             return document;
         }
     }
     return default(object);
 }
Exemplo n.º 5
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            int j = 0;

            Process[] localByName = Process.GetProcessesByName("iexplore");
            int[]     PID         = new int[localByName.Length - 1];
            for (int i = 0; i < localByName.Length; i++)
            {
                if (localByName[i].MainWindowTitle == "")
                {
                    PID[j++] = localByName[i].Id;
                }
            }

            SHDocVw.ShellWindows     shellWindows = new SHDocVw.ShellWindows();
            SHDocVw.InternetExplorer ieInst       = shellWindows.Item();
            IntPtr hid = (IntPtr)ieInst.HWND;
            //IntPtr tabHandle = FindWindowEx(hid, IntPtr.Zero, "Frame Tab", null);
            IntPtr tabHandle = GetTopWindow(IntPtr.Zero);

            while (tabHandle != IntPtr.Zero)
            {
                GetWindowThreadProcessId(tabHandle, out processID);
                for (int i = 0; i < PID.Length; i++)
                {
                    if (PID[i] == processID)
                    {
                        GetText(tabHandle);
                    }
                }
                tabHandle = GetWindow(tabHandle, GetWindow_Cmd.GW_HWNDNEXT);
            }
        }
 private void init()
 {
     this.internetExplorer              = new SHDocVw.InternetExplorer();
     this.Version                       = Version.Parse(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Internet Explorer").GetValue("svcVersion").ToString());
     internetExplorer.DocumentComplete += InternetExplorer_DocumentComplete;
     Process = Process.GetProcessById((int)GetPid);
 }
Exemplo n.º 7
0
 public DkbSession(string user, string password)
 {
     User       = user;
     Password   = password;
     ie         = new SHDocVw.InternetExplorer();
     ie.Visible = true;
 }
Exemplo n.º 8
0
        public string GetWExplorerUrl(IntPtr hWnd)
        {
            //SHDocVw.InternetExplorer ie = GetWindowsExplorer(hWnd);
            //return ie.LocationURL;
            string path       = string.Empty;
            string class_name = GetClassName(hWnd);

            SHDocVw.InternetExplorer ie = GetWindowsExplorer(hWnd);
            if (ie != null)
            {
                if (class_name == "CabinetWClass" || class_name == "ExploreWClass")
                {
                    try
                    {
                        Shell32.IShellFolderViewDual2 folderView = ie.Document as Shell32.IShellFolderViewDual2;
                        path = ((Shell32.Folder3)folderView.Folder).Self.Path;
                    }
                    catch
                    {
                    }
                }
            }
            else if (class_name == "Progman")
            {
                path = CommonInfo.UserDesktop;
            }
            //string name = folderView.Folder.Title;
            //Shell32.Folder parent = folderView.Folder.ParentFolder;
            //Shell32.FolderItem item = parent.ParseName(name);
            //MessageBox.Show(item.Path);
            return(path);
        }
Exemplo n.º 9
0
 private void m_innerBrowser_Loaded_(object sender, EventArgs e)
 {
     // Make browser control not silent: allow HTTP-Auth-dialogs. Requery command availability.
     SHDocVw.InternetExplorer ie = ActiveXControl;
     ie.Silent = false;
     CommandManager.InvalidateRequerySuggested();
 }
Exemplo n.º 10
0
        public static bool PRAP_NewClaimSearch(SHDocVw.InternetExplorer wb, SHDocVw.ShellWindows shells, string Dcn)
        {
            if (wb != null)
            {
                mshtml.HTMLDocument iePrapDoc = wb.Document;

                mshtml.HTMLInputElement prapDCNinput = null;

                iePrapDoc.getElementById("advancedSearch").click();

                while (IELib.IEGet(shells, "Advanced Search") == null)
                {
                }

                wb = IELib.IEGet(shells, "Advanced Search");
                IELib.IeWait(wb);
                iePrapDoc = wb.Document;

                int timeOutCounter = 0;
                while (prapDCNinput == null)
                {
                    prapDCNinput = iePrapDoc.getElementsByName("documentControlNumber").item(0);
                    timeOutCounter++;
                    if (timeOutCounter == 50)
                    {
                        PRAP_Functions.PRAP_CloseWindows(shells); return(false);
                    }
                }

                try { prapDCNinput.value = "0201" + Dcn; } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); }

                try { iePrapDoc.getElementById("searchButn").click(); } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); }

                while (IELib.IEGet(shells, "Search Results") == null)
                {
                }

                wb        = IELib.IEGet(shells, "Search Results");
                iePrapDoc = wb.Document;
                foreach (mshtml.IHTMLElement a in iePrapDoc.getElementsByTagName("a"))
                {
                    if (a.innerText == "0201" + Dcn)
                    {
                        a.click();
                    }
                }

                while (IELib.IEGet(shells, "Claim Inquiry Details") == null)
                {
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 11
0
 private async Task WaitAsync(SHDocVw.InternetExplorer ie, int milliseconds = 0)
 {
     while (ie.Busy ||
            ie.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
     {
         await Task.Delay(TimeSpan.FromMilliseconds(100));
     }
     await Task.Delay(TimeSpan.FromMilliseconds(milliseconds));
 }
Exemplo n.º 12
0
 public static void PRAP_Login(SHDocVw.InternetExplorer wb, string p) //Start back here
 {
     mshtml.HTMLDocument      wbDoc = wb.Document;
     mshtml.HTMLButtonElement wbButton;
     wbDoc.getElementById("user-name").innerText = System.Environment.UserName;
     wbDoc.getElementById("password").innerText  = p;
     wbButton = wbDoc.getElementsByTagName("button").item(0);
     try { wbButton.click(); } catch (Exception) { }
     IELib.IeWait(wb);
 }
Exemplo n.º 13
0
 public void quit()
 {
     if (ie == null) return;
       try
       {
     this.ie.Quit();
       }
       catch { }
       this.ie = null;
 }
Exemplo n.º 14
0
        public static void OpenIE()
        {
            Proxies.UnsetProxy();
            List<string> ipList = new List<string>();
            string ids = null;
            bool isCompleted = false;
            EventHandlers everHandlers = new EventHandlers();
            SHDocVw.InternetExplorer ieExplorer = new SHDocVw.InternetExplorer();
            object Empty = 0;
            object URL = "http://hao.360.cn/?src=lm&ls=n1b07c70297";
            ieExplorer.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(everHandlers.OnBeforeNavigate2);
            ieExplorer.Visible = true;
            ieExplorer.Navigate2(ref URL, ref Empty, ref Empty, ref Empty, ref Empty);
            ieExplorer.DocumentComplete += delegate
            {
                //var documentClass = ieExplorer.Document;
                //// mshtml.HTMLDocumentClass
                //ids = documentClass.IHTMLDocument2_body.innerHTML;
                isCompleted = true;
            };
            while (true)
            {
                if (isCompleted)
                {
                    break;

                }
            }
            if (isCompleted)
            {
                mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2)ieExplorer.Document;
                //mshtml.IHTMLElementCollection inputs = (mshtml.IHTMLElementCollection)doc2.all.tags("INPUT");
                //mshtml.HTMLInputElement input1 = (mshtml.HTMLInputElement)inputs.item("word", 0);
                //input1.value = "刘德华";
                mshtml.IHTMLElementCollection ccCollection = doc2.all.tags("A");

                //mshtml.IHTMLElement element2 = (mshtml.IHTMLElement)ccCollection;   //25新浪,73唯品会
                //int all = ccCollection.length;
                //element2.click();
                int i=0;
            }
            Thread.Sleep(5000);
            ieExplorer.Quit();

            System.Diagnostics.Process[] myProcesses;
            myProcesses = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
            foreach (System.Diagnostics.Process instance in myProcesses)
            {
                instance.CloseMainWindow();
            }
        }
Exemplo n.º 15
0
 public override WATF.Core.Page.IPage Page()
 {
     SHDocVw.ShellWindows shellwindows = new SHDocVw.ShellWindows();
     string filename;
     foreach (SHDocVw.InternetExplorer ie in shellwindows)
     {
         filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
         if (filename.Equals("iexplore"))
         {
             m_ieBrowser = ie;
             Console.WriteLine("Web Site  : {0}", ie.LocationURL);
             return new WATF.Core.Page.Page(ie.Document);
         }
     }
     return null;
 }
Exemplo n.º 16
0
        public static List<string> OperateIE(string url = "")
        {
            Proxies.UnsetProxy();
            List<string> ipList = new List<string>();
            string ids = null;
            bool isCompleted = false;
            EventHandlers everHandlers = new EventHandlers();
            SHDocVw.InternetExplorer ieExplorer = new SHDocVw.InternetExplorer();
            object Empty = 0;
            object URL = "http://vxer.daili666.com/ip/?tid=555950095890637&num=10&ports=80&filter=on";
            ieExplorer.BeforeNavigate2 +=
                new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(everHandlers.OnBeforeNavigate2);
            ieExplorer.Visible = false;
            ieExplorer.Navigate2(ref URL, ref Empty, ref Empty, ref Empty, ref Empty);
            ieExplorer.DocumentComplete += delegate
            {
                var documentClass = ieExplorer.Document;
                // mshtml.HTMLDocumentClass
                ids = documentClass.IHTMLDocument2_body.innerHTML;
                isCompleted = true;
            };
            while (true)
            {
                if (isCompleted)
                {
                    break;

                }
            }
            if (ids != null)
            {
                ids = ids.Substring(ids.IndexOf('>') + 1, ids.LastIndexOf('<') - 5);
                StringReader s = new StringReader(ids);

                while (s.Peek() > 0)
                {
                    var s1 = s.ReadLine();
                    ipList.Add(s1);
                }
                s.Close();
            }
            ieExplorer.Quit();
            return ipList;
        }
Exemplo n.º 17
0
 internal static void OpenInternetExplorerTabs(List<string> urls)
 {
     if (urls.Any())
     {
         var ie = new SHDocVw.InternetExplorer();
         ie.Navigate2(urls[0]);
         ie.Width = Screen.PrimaryScreen.WorkingArea.Width;
         ie.Height = Screen.PrimaryScreen.WorkingArea.Height;
         ie.Left = ie.Top = 0;
         for (var i = 1; i < urls.Count; i++)
             ie.Navigate2(urls[i], 0x800);
         ie.Visible = true;
     }
 }
Exemplo n.º 18
0
        // TEST ///////////////////////////////////////////////////////////////////////////////////////////
        public void start()
        {
            if (this.ie == null)
              {
            object vPost, vHeaders, vFlags, vTargetFrame, vUrl;

            vFlags = null;
            vTargetFrame = null;
            vPost = null;

            vUrl = "http://google.de";

            vHeaders = null; // "Content-Type: application/x-www-form-urlencoded" + Convert.ToChar(10) + Convert.ToChar(13);

            //Create an instance of Internet Explorer and make it visible.
            this.ie = new SHDocVw.InternetExplorer();
            this.ie.Visible = true;
            this.ie.Navigate2(ref vUrl, ref vFlags, ref vTargetFrame, ref vPost, ref vHeaders);

            Thread.Sleep(5000);

              }
        }
Exemplo n.º 19
0
        private void loadPosts()
        {
            try
            {
                error = false;
                posts.Clear();
                int count = 0;
                SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();
                IE.Visible = false;
                for (int i = (int)Math.Floor(minPage.Value); i <= (int)Math.Floor(maxPage.Value); i++)
                {
                    IE.Navigate(File.ReadAllText("MafiaUrlConfig") + "?pagenum=" + i);
                    while (IE.ReadyState.ToString() != "READYSTATE_COMPLETE")
                    {
                        System.Threading.Thread.Sleep(100);
                    }
                    if (!IE.LocationURL.ToString().Contains("pagenum") && count < 5)
                    {
                        count++;
                        i--;
                    }
                    else if (count >= 5)
                    {
                        MessageBox.Show("Could not connect to forum post. Make sure that you are logged into roll20 on Internet Explorer, and that you have the correct url.");
                        count = 0;
                        posts.Clear();
                        break;
                    }
                    else
                    {
                        var htmlDoc = IE.Document;

                        string content = htmlDoc.body.outerHTML;
                        File.WriteAllText("temporaryHold.html", content);

                        // load snippet
                        HtmlAgilityPack.HtmlDocument htmlSnippet = new HtmlAgilityPack.HtmlDocument();
                        htmlSnippet = LoadHtmlSnippetFromFile();

                        // extract Posts
                        if (ExtractAllPosts(htmlSnippet, i.ToString()) != null)
                        {
                            posts.AddRange(ExtractAllPosts(htmlSnippet, i.ToString()));
                        }
                        else
                        {
                            error = true;
                            posts.Clear();
                            break;
                        }
                    }
                }
                IE.Quit();
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("Please click on the New Game button in the bottom left of the page to add your game");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            try
            {
                using (StreamWriter sw = File.CreateText("All.html"))
                {
                    sw.WriteLine("<head>");
                    sw.WriteLine("<meta charset='utf-8'>");
                    sw.WriteLine("</head>");
                    sw.WriteLine("<body>");
                    if (!error)
                    {
                        foreach (ForumPost f in posts)
                        {
                            AddToComboBox(f.name);
                            sw.WriteLine("<table style='width:100%'><tr><td><h3><font color='" + dictionary[comboBox1.Items.IndexOf(f.name)] + "'>" + f.name + "</font></h3></td>" + "<td align='right'><h4> Page: " + f.page + "</h4></td></tr>");
                            sw.WriteLine("<h4>" + f.time + "</h4>");
                            sw.WriteLine("<p>" + f.post + "</p>");
                            sw.WriteLine();
                            sw.WriteLine("<hr>");

                        }
                        sw.WriteLine("</body>");
                    }
                    else
                    {
                        sw.WriteLine("<h1>ERROR</h1>");
                        sw.WriteLine("</body>");
                    }
                }
                NavigateWebBrowserThread(di.ToString() + "\\All.html");
                MovePostsToMainThread(posts);
                SetComboBoxToIndexThread(0);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Exemplo n.º 20
0
 private void viewDocument(ECMFolderService.documentDto doc)
 {
     if (doc != null)
     {
         //LOG.imprimeLog(System.DateTime.Now + " ========= Exibindo documento: " + doc.documentId + " - " + doc.version + " = " + doc.documentDescription);
         SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
         string url = ecmURL;
         if (!url.EndsWith("/"))
         {
             url = url + "/";
         }
         url = url + "documentviewer?WDNrDocto=" + doc.documentId + "&WDNrVersao=" + doc.version;
         //LOG.imprimeLog(System.DateTime.Now + " ========= URL: " + url);
         ie.Navigate(url);
         ie.ToolBar = 0;
         ie.AddressBar = false;
         ie.Visible = true;
     }
     else
     {
         LOG.imprimeLog(System.DateTime.Now + " ========= Lascou!!! Nao achou o documento!!");
     }
 }
Exemplo n.º 21
0
        public void Open(string url)
        {
            //Proxies.UnsetProxy();
            //string ids = null;
            bool isCompleted = false;
            EventHandlers everHandlers = new EventHandlers();
            SHDocVw.InternetExplorer ieExplorer = new SHDocVw.InternetExplorer();
            object Empty = 0;
            object URL = url;
            ieExplorer.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(everHandlers.OnBeforeNavigate2);
            ieExplorer.Visible = true;
            ieExplorer.Navigate2(ref URL, ref Empty, ref Empty, ref Empty, ref Empty);
            Timer timer=new Timer(10000);
            timer.AutoReset = false;
            timer.Start();
            timer.Elapsed += delegate { isCompleted = true; };
            ieExplorer.DocumentComplete += delegate
            {
                //var documentClass = ieExplorer.Document;
                //// mshtml.HTMLDocumentClass
                //ids = documentClass.IHTMLDocument2_body.innerHTML;
                isCompleted = true;
            };
            while (true)
            {
                if (isCompleted)
                {
                    break;

                }
            }
            if (isCompleted)
            {
                try
                {
                    if (url.Contains("2345"))
                    {
                        mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2) ieExplorer.Document;
                        mshtml.IHTMLElementCollection inputs = (mshtml.IHTMLElementCollection) doc2.all.tags("INPUT");
                        mshtml.HTMLInputElement input1 = (mshtml.HTMLInputElement) inputs.item("word", 0);
                        input1.value = "刘德华";
                        mshtml.IHTMLElementCollection ccCollection = doc2.all.tags("A");
                        int random = (new Random()).Next(25, 73); //25新浪,73唯品会
                        mshtml.IHTMLElement element2 = (mshtml.IHTMLElement) ccCollection.item("2", random);
                        element2.click();
                    }
                    if (url.Contains("360"))
                    {
                        mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2) ieExplorer.Document;
                        mshtml.IHTMLElementCollection ccCollection = doc2.all.tags("A");
                        int random = (new Random()).Next(70, 140);
                        mshtml.IHTMLElement element2 = (mshtml.IHTMLElement) ccCollection.item(random);
                        element2.click();
                    }
                }
                catch (Exception)
                {

                }
                finally
                {
                    Thread.Sleep(7000);
                    ieExplorer.Quit();

                    System.Diagnostics.Process[] myProcesses;
                    myProcesses = System.Diagnostics.Process.GetProcessesByName("IEXPLORE");
                    foreach (System.Diagnostics.Process instance in myProcesses)
                    {
                        instance.CloseMainWindow();
                    }
                    CleanIECookics.CleanCookie();
                    Thread.Sleep(7000);
                }
            }
        }
Exemplo n.º 22
0
        private void OpenWebPage(string url)
        {
            //WebPlayer wp = new WebPlayer();
            //wp.Show();
            //wp.Play(url);

            SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();

            ie.DocumentComplete += (object pDisp, ref object URL) => {

                ThreadPool.QueueUserWorkItem((o) =>
                {
                    try
                    {
                        mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document;

                        doc.bgColor = "black";

                        doc.getElementById("player").removeAttribute("style");
                        doc.getElementById("player").setAttribute("width", "100%");
                        doc.getElementById("player").setAttribute("height", "100%");
                        doc.getElementById("player").setAttribute("align", "center");

                    }
                    catch
                    {
                    }
                });

            };

            ie.Visible = true;
            ie.TheaterMode = true;
            ie.Navigate(url);

            BringWindowToTop(new IntPtr(ie.HWND));
        }
Exemplo n.º 23
0
 public void Logout()
 {
     dynamic logoutElement = Document.getElementById("logout");
     logoutElement.Click();
     Wait();
     ie.Quit();
     ie = null;
 }