|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieving a webpage source HTM and checking for a string thereinL?Hi all,
Can anyone give me any pointers on how to do the following in VB.NET? Basically, I want a procedure that will take a web URL and a string as parameters, e.g. www.microsoft.com and 'Bill Gates' I want the procedure to pull that page from the web, check for the existence of 'Bill Gates' and return either true or false depending on whether or not the string can be found. I suppose all I need to know is - what is an effecient way to pull the HTML source from any URL? Help appreciated :) How about this?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Private Function FindBill as Boolean Dim hreq As HttpWebRequest = _ HttpWebRequest.Create("http://www.microsoft.com") Dim hres As HttpWebResponse = hreq.GetResponse Dim sr As New StreamReader(hres.GetResponseStream) Dim tmpRes As String = UCase(sr.ReadToEnd) sr.Close() hres.Close() If tmpRes.IndexOf("Bill Gates") >= 0 Then Return True Else Return False End If End Function *** Sent via Developersdex http://www.developersdex.com *** "me" <c**@notvalid.com> schrieb: Check out the function at > what is an effecient way to pull the HTML source from any URL? <URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile>. You can use 'InStr' to check if a string contains a certain substring. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hi,
http://www.vb-tips.com/default.aspx?ID=541adf13-d9c0-435c-893f-56dbb63fdf1c Ken -------------------------- Show quoteHide quote "me" <c**@notvalid.com> wrote in message news:43c6d9cf$0$23285$db0fefd9@news.zen.co.uk... > Hi all, > > Can anyone give me any pointers on how to do the following in VB.NET? > > Basically, I want a procedure that will take a web URL and a string as > parameters, e.g. www.microsoft.com and 'Bill Gates' > > I want the procedure to pull that page from the web, check for the > existence > of 'Bill Gates' and return either true or false depending on whether or > not > the string can be found. > > I suppose all I need to know is - what is an effecient way to pull the > HTML source from any URL? > > Help appreciated :) > >
Show quote
Hide quote
"me" <c**@notvalid.com> wrote in message Cheers to all of you - worked a treat :)news:43c6d9cf$0$23285$db0fefd9@news.zen.co.uk... > Hi all, > > Can anyone give me any pointers on how to do the following in VB.NET? > > Basically, I want a procedure that will take a web URL and a string as > parameters, e.g. www.microsoft.com and 'Bill Gates' > > I want the procedure to pull that page from the web, check for the > existence > of 'Bill Gates' and return either true or false depending on whether or > not > the string can be found. > > I suppose all I need to know is - what is an effecient way to pull the > HTML source from any URL? > > Help appreciated :) > >
control arrays
howto make a console app start with window minimized How can you add a custom user control to a datagridview? GDI Question To use ShellExecute or not? User Control and Namespace question Export from VB.NET 2003 to an Excel spreadsheet Pointer in a structure Datagrid Plus Sign Event DataGridView... defaults to DataGridViewTextBoxColumn |
|||||||||||||||||||||||