Live Chat Icon For mobile
Live Chat Icon

How can I access a webpage from a windows form

Platform: WinForms| Category: General IO

Use the WebRequest class found in the System.Net namespace.

	//create the request object
	WebRequest req =  WebRequest.Create(@'http://www.syncfusion.com');

	//get the response and use the response
	WebResponse resp = req.GetResponse();
	Stream stream = resp.GetResponseStream();
	StreamReader sr = new StreamReader(stream);
	string s = sr.ReadToEnd();
	textBox1.Text = s;

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.