home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 November
/
Chip_1999-11_cd.bin
/
zkuste
/
VBasic
/
Data
/
ActiveX
/
msdns10.exe
/
dns_demo.frm
next >
Wrap
Text File
|
1998-02-11
|
4KB
|
131 lines
VERSION 5.00
Object = "{14AC9F3F-A2C1-11D1-8C45-0080AD1CD4EA}#15.0#0"; "MSDNS.OCX"
Begin VB.Form Form1
Caption = "DNS Lookup example for msDNS"
ClientHeight = 3060
ClientLeft = 60
ClientTop = 345
ClientWidth = 4575
LinkTopic = "Form1"
ScaleHeight = 3060
ScaleWidth = 4575
StartUpPosition = 3 'Windows-Standard
Begin msDNS.DNS DNS1
Left = 3720
Top = 2280
_ExtentX = 1085
_ExtentY = 1085
End
Begin VB.TextBox Text1
Height = 285
Index = 1
Left = 720
TabIndex = 5
Top = 1270
Width = 3615
End
Begin VB.CommandButton Query
Caption = "&Query"
Default = -1 'True
Height = 495
Left = 1800
TabIndex = 1
Top = 2400
Width = 1215
End
Begin VB.TextBox Text1
Height = 285
Index = 0
Left = 720
TabIndex = 0
Text = "www.basicworld.com"
Top = 1750
Width = 3615
End
Begin VB.Label Label2
Alignment = 1 'Rechts
Caption = "Name:"
Height = 255
Index = 1
Left = 120
TabIndex = 4
Top = 1800
Width = 495
End
Begin VB.Label Label2
Alignment = 1 'Rechts
Caption = "IP:"
Height = 255
Index = 0
Left = 120
TabIndex = 3
Top = 1320
Width = 495
End
Begin VB.Label Label1
Caption = "Please enter either an IP address or a servername and press ""Query"" to query your DNS server for the missing information:"
Height = 975
Left = 240
TabIndex = 2
Top = 240
Width = 4215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private UnusedField As Integer
Private Sub DNS1_Ready(ByVal Status As Integer)
Select Case Status
Case dnsReady
Text1(0) = DNS1.HostName
Text1(1) = DNS1.HostIP
Case dnsError
If Text1(0) = "" Then Text1(0) = "(DNS error)" Else Text1(1) = "(error)"
Case dnsNotFound
If Text1(0) = "" Then Text1(0) = "(address not found)" Else Text1(1) = "(not found)"
End Select
Screen.MousePointer = 0
End Sub
Private Sub DNS1_SocketError(ByVal Number As Integer, ByVal Description As String)
MsgBox "A socket error occured:" & vbCrLf & Description, "Sorry!"
Screen.MousePointer = 0
End Sub
Private Sub Form_Load()
UnusedField = 1
End Sub
Private Sub Query_Click()
Text1(UnusedField) = ""
Screen.MousePointer = vbHourglass
If Text1(1) = "" Then
DNS1.HostName = Text1(0)
Else
DNS1.HostIP = Text1(1)
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
With Text1(Index)
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
UnusedField = IIf(Index = 0, 1, 0)
End Sub