C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Web Browser in C#.Net 2.0 (Windows)


Posted Date: 06 Aug 2008      Total Responses: 1

Posted By: Muralee Krishnan.K       Member Level: Gold     Points: 1



How can i copy the content from the Web browser to the textbox in another form in windows with the html tags

Muralee Krishnan.K





Responses

Author: Ilyas    06 Aug 2008Member Level: SilverRating:     Points: 6

Hi

The Method is called Screen Scraping:


little example

private void Page_Load(object sender, System.EventArgs e)
{
//Retrieve URL from user textbox
if(Page.IsPostBack)
textbox1.Text = GetHtml( textbox2.Text );
//get the url in textbox2 and pass it to the method
}

public String GetHtml(string strURL)
{

String strResult;
WebResponse objResp;
WebRequest objReq = HttpWebRequest.Create(strURL);
objResponse = objReq.GetResponse();

using (StreamReader sr =
new StreamReader(objResp.GetResponseStream()))
{
strResult = sr.ReadToEnd();

sr.Close();
}
return result;
}


regards

Ilyas F



Post Reply
You must Sign In to post a response.
Next : binding data to the combobox in c#
Previous : Web Browser in C#.Net 2.0 (Windows)
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use