PC Review


Reply
Thread Tools Rate Thread

Checking Site Status ?

 
 
T :-\)
Guest
Posts: n/a
 
      22nd Oct 2004
hi,

I have a list of URL's which i would like to check if they are response
(return 200 OK).

what is the best way to do that ?

Thanks,

T;-)


 
Reply With Quote
 
 
 
 
Carlos J. Quintero [MVP]
Guest
Posts: n/a
 
      22nd Oct 2004
Try:

Dim objTcpClient As System.Net.Sockets.TcpClient
Dim objNetworkStream As System.Net.Sockets.NetworkStream
Dim iBytesCount As Integer
Dim objBuffer(2000) As Byte
Dim sData As String


Try

objTcpClient = New System.Net.Sockets.TcpClient

objTcpClient.Connect("pop.mail.yahoo.com", 110) // your data
here

objNetworkStream = DirectCast(objTcpClient.GetStream(),
System.Net.Sockets.NetworkStream)
iBytesCount = objNetworkStream.Read(objBuffer, 0,
objBuffer.Length)

If iBytesCount > 0 Then
sData = System.Text.Encoding.ASCII.GetString(objBuffer)
MessageBox.Show(sData)
End If

Catch objException As Exception

MessageBox.Show(objException.GetBaseException.ToString)

Finally

If Not (objNetworkStream Is Nothing) Then
objNetworkStream.Close()
End If

If Not (objTcpClient Is Nothing) Then
objTcpClient.Close()
End If

End Try


--

Carlos J. Quintero (Visual Developer - .NET MVP)

The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com


"T :-)" <(E-Mail Removed)> escribió en el mensaje
news:%(E-Mail Removed)...
> hi,
>
> I have a list of URL's which i would like to check if they are response
> (return 200 OK).
>
> what is the best way to do that ?
>
> Thanks,
>
> T;-)
>
>



 
Reply With Quote
 
T :-\)
Guest
Posts: n/a
 
      22nd Oct 2004
Thanks.

"Carlos J. Quintero [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try:
>
> Dim objTcpClient As System.Net.Sockets.TcpClient
> Dim objNetworkStream As System.Net.Sockets.NetworkStream
> Dim iBytesCount As Integer
> Dim objBuffer(2000) As Byte
> Dim sData As String
>
>
> Try
>
> objTcpClient = New System.Net.Sockets.TcpClient
>
> objTcpClient.Connect("pop.mail.yahoo.com", 110) // your data
> here
>
> objNetworkStream = DirectCast(objTcpClient.GetStream(),
> System.Net.Sockets.NetworkStream)
> iBytesCount = objNetworkStream.Read(objBuffer, 0,
> objBuffer.Length)
>
> If iBytesCount > 0 Then
> sData = System.Text.Encoding.ASCII.GetString(objBuffer)
> MessageBox.Show(sData)
> End If
>
> Catch objException As Exception
>
> MessageBox.Show(objException.GetBaseException.ToString)
>
> Finally
>
> If Not (objNetworkStream Is Nothing) Then
> objNetworkStream.Close()
> End If
>
> If Not (objTcpClient Is Nothing) Then
> objTcpClient.Close()
> End If
>
> End Try
>
>
> --
>
> Carlos J. Quintero (Visual Developer - .NET MVP)
>
> The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com
>
>
> "T :-)" <(E-Mail Removed)> escribió en el mensaje
> news:%(E-Mail Removed)...
> > hi,
> >
> > I have a list of URL's which i would like to check if they are response
> > (return 200 OK).
> >
> > what is the best way to do that ?
> >
> > Thanks,
> >
> > T;-)
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking firewall status Maxi Windows XP General 6 17th Oct 2006 09:00 AM
checking a socket status Abubakar Microsoft VC .NET 6 20th Mar 2006 05:38 AM
Checking Protect status =?Utf-8?B?THVsdQ==?= Microsoft Excel Programming 2 2nd Nov 2004 08:24 PM
Checking status of sent message Rhonda Microsoft Outlook Discussion 2 27th Aug 2004 08:54 PM
Checking status of ink cartridge Mary Windows XP Basics 4 22nd Nov 2003 01:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.