Download a file through the WebBrowser control

前端 未结 3 463
南旧
南旧 2020-12-01 15:26

I have a WebBrowser control on a form, but for the most part it remains hidden from the user. It is there to handle a series of login and other tasks. I have to use<

3条回答
  •  悲&欢浪女
    2020-12-01 15:36

        bool documentCompleted = false;
        string getInnerText(string url)
        {
            documentCompleted = false;
            web.Navigate(url);
    
            while (!documentCompleted)         
                Application.DoEvents();
    
    
            return web.Document.Body.InnerText;
        }
        private void web_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            documentCompleted = true;
        }
    

提交回复
热议问题