473,387 Members | 1,722 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,387 software developers and data experts.

Checking if a website has been updated

Doe anyone know how I can check if a html document on a webserver is modified since my last check? I can't figure it out my self :(

I'm using visual studio 2005.

Thanks in advance,

H-Des
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Nov 30 '05 #1
2 990
"H-Des" <fa**@fake.fa> wrote:
Doe anyone know how I can check if a html document on a webserver is
modified since my last check? I can't figure it out my self :(

Download the file using 'WebClient.DownloadFile' or the function presented
at <URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile> and
compare the file's content to the content retreived before.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #2
HDes,

Have a look at this sample. AFAIK is there is as well in the header a
property for the last time updated.

\\\not tested as is
dim conlength as string
Dim wbRq As HttpWebRequest = DirectCast(WebRequest.Create("Url"),
HttpWebRequest)
wbRq.Timeout = 2000
Try
Dim wbRs As HttpWebResponse = DirectCast(wbRq.GetResponse(),
HttpWebResponse)
Dim wbHCol As WebHeaderCollection = wbRs.Headers
For i As Integer = 0 To wbHCol.Count - 1
Dim header As String = wbHCol.GetKey(i)
Dim values As String() = wbHCol.GetValues(header)
If values.Length > 0 andalso header.Tolower = "content-lenght" Then
conlenght = values(0)
End If
Next
wbRs.Close()
Catch
conlength = "?"
End Try
///

I hope this helps a little bit?

Cor
Nov 30 '05 #3

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

Similar topics

4
by: Toby Newman | last post by:
Hi, I run a community website (forum and wiki) that is updated perhaps once every 10 minutes by a user. My bandwidth usage is quite high because the 40 users generally sit there pressing F5...
3
by: Steven Scaife | last post by:
Below is my ASP page, I have changed the update to read DRIAL which doesn't exist, shouldnt this throw an error, or if the connection cannot be made shouldnt it throw an error as well thanks in...
0
by: CC CC | last post by:
I am new to the .Net framework and have run across an interesting development issue and was wondering is someone has run across this before or had some solution ideas. The problem is this. ...
2
by: Christopher | last post by:
Hi all, Sorry if this is a silly question but I've been having a heck of a hard time with it and hope somebody here can lend me a hand. I have a site with a news pages and I'd like the...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
2
by: Mike | last post by:
Hello, Ok I have 2 classes in my project, one is the main form and one is a connection class, at a certain event on my main form a new instance is made of the connection class, and a reference...
8
by: MarkusJNZ | last post by:
Hi, I need to write some code to ensure that a website is still online. I was just going to write some code (Using System.NET webrequest) to retrieve the HTML from a website and if the length...
2
by: RobertEB | last post by:
I have a website I inherited. It was built in VS.net 2002. I have converted it to VS.net 2005. It runs great on my test server, but how do I replace my current website without screwing it up? I am...
6
by: maxx429 | last post by:
I am trying to check if notes have been added to a Memo field on a form if certain other fields have changed. Example: If the user ticks a particular check box on the form, I want to force them to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.