Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing MainForm.frm (6.16 KB)
VERSION 5.00
Begin VB.Form MainForm
Caption = "IP Converter"
ClientHeight = 1455
ClientLeft = 60
ClientTop = 345
ClientWidth = 4155
Icon = "MainForm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1455
ScaleWidth = 4155
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command3
Caption = "&Open"
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 5
ToolTipText = "Open the IP Integer in your web browser"
Top = 960
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3830
Style = 1 'Graphical
TabIndex = 2
ToolTipText = "Obtain IP address from a host"
Top = 120
Width = 270
End
Begin VB.CommandButton Command1
Caption = "Close"
Default = -1 'True
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 6
Top = 960
Width = 1095
End
Begin VB.TextBox Text2
Alignment = 2 'Center
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 1080
Locked = -1 'True
TabIndex = 4
Top = 480
Width = 2655
End
Begin VB.TextBox Text1
Alignment = 2 'Center
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 1080
MaxLength = 15
TabIndex = 1
Top = 120
Width = 2655
End
Begin VB.Image Image1
Height = 480
Left = 120
Picture = "MainForm.frx":0442
ToolTipText = "IP Converter v1.0 by Jason's PC Software"
Top = 960
Width = 480
End
Begin VB.Label Label2
Caption = "IP &Integer:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 3
Top = 520
Width = 855
End
Begin VB.Label Label1
Caption = "IP &Address:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 0
Top = 200
Width = 855
End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Const SW_NORMAL = 1
Private Declare Function ShellExecute Lib "shell32" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub LaunchURL(ByVal URL As String)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, SW_NORMAL
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
RevDNSForm.Show 1
End Sub
Private Sub Command3_Click()
LaunchURL "http://" + Text2.Text + "/"
End Sub
Private Sub Form_Load()
CButton Command2
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub Text1_Change()
On Error GoTo ErrHandler
Dim i1 As Integer, i2 As Integer, i3 As Integer
i1 = InStr(Text1.Text, ".")
i2 = InStr(i1 + 1, Text1.Text, ".")
i3 = InStr(i2 + 1, Text1.Text, ".")
If i2 > i1 And i3 > i2 And i3 > 0 Then
Text2.Text = (Val(Left(Text1.Text, i1 - 1)) * 256 ^ 3) + (Val(Mid(Text1.Text, i1 + 1, i2 - i1 - 1)) * 256 ^ 2) + (Val(Mid(Text1.Text, i2 + 1, i3 - i2 - 1)) * 256) + Val(Mid(Text1.Text, i3 + 1))
Else
Text2.Text = ""
End If
Exit Sub
ErrHandler:
Text2.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or KeyAscii = 46 Then Exit Sub
KeyAscii = 0
End Sub
Private Sub Text2_Change()
If Text2.Text = "" Then
Command3.Enabled = False
Else
Command3.Enabled = True
End If
End Sub