473,486 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Design question regarding Web Site Monitoring

I am looking for a VB.NET code that I can use to monitor an independent Web
Site, I would like to do an equivalent of a PING of the site every 5 minutes
or so and make sure that it returns the appropriate login is screen. I then
will use the response to send an email if the site is not responding properly.

I would think that somewhere on the Web this code exists but I could not
find it. Can someone point me to such a site?
Nov 21 '05 #1
8 1257
Genojoe,

If it is as simple as you write than you can use the processtart in a timer
event and than every time catch the answer.

I once made a sample for somebody however it is in C# and I don't have it
directly in VBNet. I assume that you can use it.

http://groups-beta.google.com/group/...9d1b82c9?hl=en

If you really cannot translate it, tell it, than I do that.

I hope this helps,

Cor
Nov 21 '05 #2
Conversion was easy using:
http://authors.aspalliance.com/aldot...translate.aspx

This solution executes PING and gives the standard PING response. Actually,
I want to hit the site with a string such as google.com then read sufficient
information from the return so that I can verify that the correct page is
being displayed. For example, I want to verify that the return page contains
"Please enter your login ID"

I modified your code slightly but when I execute it, it only opens the Web
site and does not return anything to p.StandardOutput.

Here is the code that I used:

Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "www.google.com"
pi.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
p.StartInfo = pi
p.Start()
Dim sr As System.IO.StreamReader = p.StandardOutput
Dim s As String = sr.ReadToEnd
MsgBox(s)

"Cor Ligthert" wrote:
http://groups-beta.google.com/group/...9d1b82c9?hl=en


Nov 21 '05 #3
Joe,

I modified your code slightly but when I execute it, it only opens the Web
site and does not return anything to p.StandardOutput.

Because that I gave you the wrong one.

:-)

You know how to translate you said.

\\\
Process p = new Process();
ProcessStartInfo pi = new ProcessStartInfo();
pi.UseShellExecute = false;
pi.RedirectStandardOutput = true;
pi.Arguments = "www.google.com";
pi.WorkingDirectory = "C:\\windows\\system32";
//this for nt* computers
pi.FileName = "ping";
p.StartInfo = pi;
p.Start();
System.IO.StreamReader sr = p.StandardOutput;
System.Text.StringBuilder sb = new System.Text.StringBuilder("");
int input = sr.Read();
while (input != -1)
{
sb.Append((char) input);
input = sr.Read();
}
MessageBox.Show(sb.ToString());
///

Sorry

Cor
Nov 21 '05 #4
I had your code correctly translated to what you showed below.
Unfortunately, that is not what I want to happen. I do not want to execute
PING. Instead, I want to open the returning HTML code and search to see if
it contains "Please enter your login ID."

The code that I displayed was a modification of your code in an attempt to
accomplish this result.
Nov 21 '05 #5
Joe,

You can use axwebbrowser or Httprequest for that, there are tons of software
for what you ask on Internet. I have myself as well samples for that, you
can search for those in Google newsgroups. However they fit only a part of
your question. Raw HTML data is not easy to check using a program.

Cor
Nov 21 '05 #6
Joe,

You can use axwebbrowser or Httprequest for that, there are tons of software
for what you ask on Internet. I have myself as well samples for that, you
can search for those in Google newsgroups. However they fit only a part of
your question. Raw HTML data is not easy to check using a program.

Cor
Nov 21 '05 #7
FYI; Here is the code that I found. Inspiration came from:
http://www.w3coder.com

Dim myHttpWebRequest As HttpWebRequest =
CType(WebRequest.Create("http://www.mangia.tzo.com/CMS"), HttpWebRequest)
Dim myHttpWebResponse As HttpWebResponse =
CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()
Dim encode As System.Text.Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim readStream As New StreamReader(receiveStream, encode)
Dim s As String = readStream.ReadToEnd()
Dim i As Integer = InStr(s, "User Name:")

If i > 0 Then
C.MsgInfo("Site contains ""User Name""")
End If

readStream.Close()
myHttpWebResponse.Close()
"genojoe" wrote:
Nov 21 '05 #8
FYI; Here is the code that I found. Inspiration came from:
http://www.w3coder.com

Dim myHttpWebRequest As HttpWebRequest =
CType(WebRequest.Create("http://www.mangia.tzo.com/CMS"), HttpWebRequest)
Dim myHttpWebResponse As HttpWebResponse =
CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()
Dim encode As System.Text.Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim readStream As New StreamReader(receiveStream, encode)
Dim s As String = readStream.ReadToEnd()
Dim i As Integer = InStr(s, "User Name:")

If i > 0 Then
C.MsgInfo("Site contains ""User Name""")
End If

readStream.Close()
myHttpWebResponse.Close()
"genojoe" wrote:
Nov 21 '05 #9

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

Similar topics

1
2476
by: madunix | last post by:
We are a public utility institution established by virtue of the Securities Law. The Company oversees securities' registration, deposit, transfer of ownership and clearing and settlement. The...
25
2790
by: John Morgan | last post by:
Though I have designed and implemented a number of large reasonably well received web sites I do not consider myself a graphics designer I am now for the first time going to work with a ...
3
1986
by: Sorin Dolha | last post by:
Hello, We intend to create an ASP.NET-based Web application (hosted on Internet Information Services, or IIS) and one feature of the application needs to allow the end user to upload photos to...
4
2454
by: Macca | last post by:
Hi, I have an windows forms application that accesses a SQL database I have a few questions as to connecting to the database. This application will run 24 hours a day. It is a monitoring...
12
1323
by: Jacob Crossley | last post by:
Please tell me there is a way to prevent this annoyance ; - ) I'm into writing perfectly indented html, but the .net dev environment is being overzealous and messing up my html formatting. for...
1
4333
by: amit.vasu | last post by:
Hi I have created a web serivces using .net framework 2.0. When I try to execute the web service I get the following error. Failed to start monitoring changes to 'e:\Default Web Site' because...
3
1436
by: PeterKellner | last post by:
I have a project where a html designer gives me a pile of html to wire up. I do that and it works fine of course. Then, the html designer makes a bunch of changes, give me back the revised aspx...
0
2490
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
22
3638
by: Jesse Burns | last post by:
I'm about to start working on my first large scale site (in my opinion) that will hopefully have 1000+ users a day. ok, this isn't on the google/facebook scale, but it's going to be have more hits...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.