'// Private member that holds a reference to
'// the path of our ini file
Private strInI As String
'// Win API Declares
Private Declare Function WritePrivateProfileString _
Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, _
ByVal lpString As Any, _
ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, _
ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Private Function MakePath(ByVal strDrv As String, _
ByVal strDir As String) As String
'// Makes an INI file: Guarantees a sub dir
Do While Right$(strDrv, 1) = ""
strDrv = Left$(strDrv, Len(strDrv) - 1)
Loop
Do While Left$(strDir, 1) = ""
strDir = Mid$(strDir, 2)
Loop
'// Return the path
MakePath = strDrv & "" & strDir
End Function
Public Sub CreateIni(strDrv As String, strDir As String)
'// Make a new ini file
strInI = MakePath(strDrv, strDir)
End Sub
Public Sub WriteFile(strSection As String, _
strKey As String, _
strValue As String)
'// Write to strINI
WritePrivateProfileString strSection, _
strKey, strValue, strInI
End Sub
Public Function GetFile(strSection As String, _
strKey As String) As String
VERSION 5.00
Begin VB.Form frmTCPIP
BorderStyle = 3 'Fixed Dialog
Caption = "TCPIP Settings"
ClientHeight = 1665
ClientLeft = 2580
ClientTop = 1800
ClientWidth = 3720
Icon = "frmTCPIP.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 1665
ScaleWidth = 3720
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CheckBox Check1
Caption = "Trace"
Height = 255
Left = 2640
TabIndex = 6
Top = 120
Width = 975
End
Begin VB.CommandButton cmdOKCancel
Caption = "Cancel"
Height = 375
Index = 1
Left = 2640
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.CommandButton cmdOKCancel
Caption = "OK"
Default = -1 'True
Height = 375
Index = 0
Left = 2640
TabIndex = 2
Top = 480
Width = 855
End
Begin VB.TextBox txtPort
Height = 375
Left = 120
TabIndex = 1
Text = "23"
Top = 1080
Width = 2295
End
Begin VB.TextBox txtRemoteAddress
Height = 375
Left = 120
TabIndex = 0
Text = "127.0.0.0"
Top = 360
Width = 2295
End
Begin VB.Label Label1
Caption = "Remote IP Port"
Height = 255
Index = 1
Left = 120
TabIndex = 5
Top = 840
Width = 2055
End
Begin VB.Label Label1
Caption = "Remote IP Address"
Height = 255
Index = 0
Left = 120
TabIndex = 4
Top = 120
Width = 2055
End
End
Attribute VB_Name = "frmTCPIP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Check1_Click()
If Check1.Value = 1 Then
frmTelnet.TraceTelnet = True
frmTelnet.Tracevt100 = True
Else
frmTelnet.TraceTelnet = False
frmTelnet.Tracevt100 = False
End If
End Sub
Private Sub cmdOKCancel_Click(Index As Integer)
On Error Resume Next
Select Case Index
Case 0
frmTelnet.WinsockClient.Close
frmTelnet.WinsockClient.LocalPort = 0
frmTelnet.RemoteIPAd = txtRemoteAddress
frmTelnet.RemotePort = txtPort
frmTelnet.WinsockClient.RemotePort = txtPort
frmTelnet.WinsockClient.RemoteHost = txtRemoteAddress
If Err > 0 Then
MsgBox Error
Else
Unload Me
End If
Case 1
Unload Me
End Select
End Sub
Private Sub Form_Load()
txtRemoteAddress = frmTelnet.RemoteIPAd
txtPort = frmTelnet.RemotePort
' Check1.Value = -(frmTelnet.TraceTelnet)
End Sub
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmTelnet
Caption = "weit's Telnet Client 1.1"
ClientHeight = 9120
ClientLeft = -210
ClientTop = 3015
ClientWidth = 13590
FillColor = &H00800000&
FillStyle = 0 'Solid
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Icon = "telnet.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 9120
ScaleWidth = 13590
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text13
Height = 375
Left = 10800
TabIndex = 35
ToolTipText = "从亿讯查上网记录查VLanID输入"
Top = 5040
Width = 615
End
Begin VB.CommandButton Command14
Caption = "alcate通过MAC查端口"
Height = 375
Left = 11520
TabIndex = 34
Top = 5040
Width = 1935
End
Begin VB.CommandButton Command13
Caption = "用IP连"
Height = 375
Left = 10440
TabIndex = 33
Top = 2640
Width = 735
End
Begin VB.CommandButton Command12
Caption = "alcatel设置状态"
Height = 375
Left = 11520
TabIndex = 32
Top = 4560
Width = 1935
End
Begin VB.CommandButton Command11
Caption = "send"