net8

 

Get The Last Modified Date Of A Web Page


Get The Last Modified Date Of A Web Page

Some web pages have the information about the last date they have been
modified.
You can get this date from Visual Basic.
If the web page doesn't have this information, you will get an empty
String.


Preparations

Add the Microsoft Internet Transfer Control to your program (from VB menu
choose Project-> components..., mark the Microsoft Internet Transfer
Control check box, and press OK. Then drag the control to your form).

Add 1 Command Button to your form.
Press the button to see the web page last modified date.
You may wait few seconds untill the Internet Transfer Control will grab
the information from the internet.


Form Code

Private Sub Command1_Click()
' replace the "http://www.microsoft.com" below with the URL of the
' web page you want to get its last modified date
Inet1.OpenURL "http://www.microsoft.com"
MsgBox Inet1.GetHeader("Last-modified")
End Sub