Hi
I have developed one application in VB.NET which extracts
the source code of Web pages.I gave a bunch of URLs in a
listbox while at the time of response from the web it was
struckup.Sometimes it gives output but sometimes it was
struckup,i don't know the reason why it was strucked.
If u know please let me know.Here it my source code.
Public Function GetSource(ByVal url As String) As String
Dim strURL As String
Dim fsoStream As Scripting.TextStream
Dim mFso As New Scripting.FileSystemObject
Dim s, s1, str1 As String
Dim Source As New System.Text.StringBuilder
Dim WebResponse As Net.WebResponse =
Net.WebRequest.Create(url).GetResponse
Dim StreamReader As New IO.StreamReader
(WebResponse.GetResponseStream(),
System.Text.Encoding.ASCII)
Do
Source.Append(StreamReader.ReadLine() + vbCrLf)
Loop Until StreamReader.ReadLine() Is Nothing
StreamReader.Close()
'Return Source.ToString()
TextBox2.Text = Source.ToString()
fsoStream = mFso.OpenTextFile
(Application.StartupPath & "\example.txt",
Scripting.IOMode.ForWriting)
fsoStream.Write(TextBox2.Text)
fsoStream.Close()
fsoStream = Nothing
End Function