Author : Dipen Anovadia
Date Submitted : 4/15/2006
Category : Internet
Compatibility : VB 6,VB 5
This code has been accessed 3006 times.
Task : DISPLAYS THE 'DNS ERROR' PAGE, AS DISPLAYED IN INTERNET EXPLORER WHEN THE PAGE REQUESTED IS NOT AVAILABLE.
Declarations
Code
'Controls:
' Command Button - Command1
Public Function SystemDir() As String
Dim sBuffer As String
sBuffer = String(255, Chr$(0))
Call GetSystemDirectory(sBuffer, Len(sBuffer))
SystemDir = Replace(sBuffer, Chr$(0), "")
End Function
Public Function DNSError(sURL As String) As Long
Dim sCommand As String
sCommand = "res://" & SystemDir() & "\SHDOCLC.DLL/dnserror.htm#"
sCommand = sCommand & sURL
DNSError = ShellExecute(0&, "open", sCommand, vbNullString, vbNullString, 1&)
End Function
Private Sub Command1_Click()
'Setting return value to caption for just information only...
Caption = DNSError(Text1)
End Sub
'Errors, feedbacks, etc...
'MAIL: dippu75@hotmail.com