none
HttpWebRequest in WPF

    Question

  • As shown through the property webbrowse in a WPF application by pressing a button?

     

    public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
            }
     
            private void button1_Click(object sender, RoutedEventArgs e)
            {
     
            }
           
            private void webBrowser1_LoadCompleted(object sender, NavigationEventArgs e)
            {
                HttpWebRequest HttpWReq =
                (HttpWebRequest)WebRequest.Create("http://www.contoso.com");
     
                HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
               
                HttpWResp.Close();
            }
            
        }
    }
    
    Or is it better to use the Webbrowser class?

     


    • Edited by Stenl1 Wednesday, January 04, 2012 1:51 PM
    • Moved by Martin_Xie Thursday, January 05, 2012 2:37 AM Move it to WPF Forum for better support. (From:Visual C# General)
    Wednesday, January 04, 2012 1:48 PM

All replies

  • Huh? Why don't you just use a simple webBrowser1.Navigate("http://www.contoso.com") call in your button1_Click event?
    Wednesday, January 04, 2012 1:51 PM
  • I would like to make it through the HttpWebResponse and HttpWebRequest in WPF. To view the press links on the page in Webbrowse!
    Wednesday, January 04, 2012 2:28 PM
  • To view the press links on the page in Webbrowse!
    Can you please rephrase that?!
    Wednesday, January 04, 2012 4:01 PM
  • As I understand this I do not get = (And how then do that at work with WebBrowse class is not used Internet Explorer, and used mozila firefox or opera? Or is it impossible?
    Wednesday, January 04, 2012 4:01 PM
  • Can you please rephrase that?!
    Go to the web site and perform some action there. As on-line robot. Only by using the HttpWebRequest and HttpWebResponse, but that all the transitions on a web page can be seen in the browser window, ie a property webbrowse in WPF.
    Wednesday, January 04, 2012 4:09 PM
  • I see. I would feed the WebBrowser control via my own web proxy. This proxy uses the data you have downloaded.
    Thursday, January 05, 2012 8:47 AM
  • Hi Stenl1,

    How about your issue?

     


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 17, 2012 8:15 AM