473,385 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Checking Site Status ?

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;-)
Nov 21 '05 #1
2 1073
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.ToSt ring)

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 :-)" <ti*****@netvision.net.il> escribió en el mensaje
news:%2****************@TK2MSFTNGP09.phx.gbl...
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;-)

Nov 21 '05 #2
Thanks.

"Carlos J. Quintero [MVP]" <ca*****@NOSPAMsogecable.com> wrote in message
news:eF**************@tk2msftngp13.phx.gbl...
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.ToSt ring)

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 :-)" <ti*****@netvision.net.il> escribió en el mensaje
news:%2****************@TK2MSFTNGP09.phx.gbl...
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;-)


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc S. Gibian | last post by:
I am putting together a Perl tool to manage a large set of tasks related to building a rather complex set of software. One of the goals for moving to Perl is to provide very rigorous error checking...
2
by: Harag | last post by:
Hi all win 2k pro sql server 2k asp - vbscript I got the below code from somewhere ages ago. I have a list of links on my site that link to other sites but I want to check if the link is...
1
by: Rob Meade | last post by:
Hi all, Ok - minor problem - looking for work-a-rounds... I want to offer on our organisations intranet a support site for our webmasters, one of the features I'd like to add is a server...
1
by: MSDN Account | last post by:
We have web site that used the IIS ResKit tool MSWC.PermissionChecker to check file permissions. The web site has been upgraded and that upgrade included changing the default server side language...
2
by: Maziar Aflatoun | last post by:
Hi everyone, I am reading and displaying data rows from my database where the first column contains the Status checkbox. I like to enable my users to change the status of individual rows by...
7
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception...
4
by: www.gerardvignes.com | last post by:
I'd like to join or start a small group of Ajax web developers who are willing to smoke test each others Ajax applications, quid pro quo. I can smoke test on W2K SP4 with IE6, FF2, SM 1 and O9. ...
9
by: perls | last post by:
"Newbie needs help" Hi all, I had a programmer do a site scraping script for me.. the aim was to scrape data from 5 different sites and upload directly into my website databse. I started to...
3
by: David | last post by:
Hi, Is there a general way of placing an 'error_check' include file into my website, and put the include line onto all 'asp' pages. In the event that any error occurs on any asp page or with the...
1
by: rpupkin77 | last post by:
Hi, I have written this script to run as a cron that will loop through a text file with a list of urls. It works fine for most of the links, however there are a number of urls which are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.