Web page search

through source...

Page 1 of 1

1 Replies - 936 Views - Last Post: 15 January 2009 - 12:02 PM Rate Topic: -----

#1 yungbol  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 39
  • Joined: 09-December 08

Web page search

Post icon  Posted 14 January 2009 - 04:05 PM

I am creating an app that will search for a specific string (textbox1) through the source of a webpage. I made the code to get the source, I just need help on the search on how to search through it. If it is found, a MessageBox or label will show with a found result.

		/// <summary>
		/// Get a string representation of a webpage's source.
		/// </summary>
		/// <param name="URL">The URL to get the source from.</param>
		/// <returns></returns>
		string getPageSource(string URL)
		{
			System.Net.WebClient webClient = new System.Net.WebClient();
			string strSource = webClient.DownloadString(URL);
			webClient.Dispose();
			return strSource;
		}


Is This A Good Question/Topic? 0
  • +

Replies To: Web page search

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 421
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Web page search

Posted 15 January 2009 - 12:02 PM

Use the String.Contains method to search through the source.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1