📄 form1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
BorderStyle = 4 'Fixed ToolWindow
Caption = "枫之谷 登陆器"
ClientHeight = 3225
ClientLeft = 45
ClientTop = 315
ClientWidth = 5790
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3225
ScaleWidth = 5790
StartUpPosition = 2 '屏幕中心
Begin MSWinsockLib.Winsock Wsk2
Left = 3120
Top = 2280
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin MSWinsockLib.Winsock Wsk1
Left = 3600
Top = 2280
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 3960
Top = 2280
End
Begin VB.CommandButton Command5
Appearance = 0 'Flat
Caption = "开始游戏"
Enabled = 0 'False
Height = 735
Left = 4440
TabIndex = 6
Top = 2400
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 3360
TabIndex = 5
Top = 2760
Width = 855
End
Begin VB.CommandButton Command3
Caption = "论坛"
Height = 375
Left = 2280
TabIndex = 4
Top = 2760
Width = 855
End
Begin SHDocVwCtl.WebBrowser WebBrowser1
Height = 2295
Left = 0
TabIndex = 3
Top = 0
Width = 5775
ExtentX = 10186
ExtentY = 4048
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 1
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
NoWebView = 0 'False
HideFileNames = 0 'False
SingleClick = 0 'False
SingleSelection = 0 'False
NoFolders = 0 'False
Transparent = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "http:///"
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 75
Left = 0
TabIndex = 2
Top = 3165
Width = 5800
_ExtentX = 10239
_ExtentY = 132
_Version = 393216
Appearance = 0
Scrolling = 1
End
Begin VB.CommandButton Command2
Caption = "主页"
Height = 375
Left = 1200
TabIndex = 1
Top = 2760
Width = 855
End
Begin VB.CommandButton Command1
Caption = "注册"
Height = 375
Left = 120
TabIndex = 0
Top = 2760
Width = 855
End
Begin VB.Label Label1
Height = 255
Left = 120
TabIndex = 7
Top = 2400
Width = 4095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private filemd5 As Boolean
Private Ip As String
Private Port As Integer, lianjie As Integer, shijian As Integer
Private Sub Command1_Click()
Shell "explorer http://bbs.99net.com", vbMaximizedFocus
End Sub
Private Sub Command2_Click()
Shell "explorer http://bbs.99net.com", vbMaximizedFocus
End Sub
Private Sub Command3_Click()
Shell "explorer http://bbs.99net.com", vbMaximizedFocus
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Me.Show
Command5.Enabled = False
Ip = "192.168.160.17"
Port = 8485
Call jiance
End Sub
Private Sub Timer1_Timer()
'If filemd5 = True Then
' If exitproc("GameStart.dll") Then
' TerminateFileName "GameStart.dll"
' Else
' If Command5.Enabled = False Then
' Command5.Enabled = True
' End If
' If Timer1.Interval = 1800000 Then
' Timer1.Interval = 1800000
' Else
' Timer1.Interval = Timer1.Interval + 5000
' End If
' Select Case Wsk1.State
' Case 0
' Wsk1.Connect Ip, Port
' Label1.Caption = "正在连接验证服务器..."
' Case 1
' Wsk1.Connect Ip, Port
' Label1.Caption = "正在连接验证服务器..."
' Case 6
' Label1.Caption = "正在连接验证服务器..."
' Case Else
' Label1.Caption = "错误,状态:" & Wsk1.State
' End Select
' End If
'End If
'Timer1.Enabled = False
If Wsk1.State <> 7 Then
Label1.Caption = "正在连接验证服务器..." & shijian
shijian = shijian - 1
If shijian < 0 Then
If Wsk1.State = 6 Or Wsk1.State = 9 Then
Wsk1.Close
If lianjie > 0 Then
Wsk1.Connect Ip, Port
DoEvents
Label1.Caption = "自动连接剩余次数(" & lianjie & ")"
lianjie = lianjie - 1
shijian = 5
Else
Timer1.Enabled = False
MsgBox "自动连接失败,请联系GM"
End
End If
Else
Label1.Caption = "错误,状态:" & Wsk1.State
Timer1.Enabled = False
End If
End If
End If
End Sub
Private Sub jiance()
filemd5 = True
Label1.Caption = "检测文件中..."
DoEvents
If HashFile("F:\MapleStory\Map.wz") <> "6A34E6FD7173D99A95A546F508E937DD" Then
Label1.Caption = "Map.wz文件被非法修改"
filemd5 = False
End If
ProgressBar1.Value = 50
DoEvents
If HashFile("F:\MapleStory\Skill.wz") <> "0FD2B8D748C7D73B221A517083C3D427" Then
Label1.Caption = "Skill.wz文件被非法修改"
filemd5 = False
End If
DoEvents
ProgressBar1.Value = 100
If filemd5 = True Then
If exitproc("GameStart.dll") Then
TerminateFileName "GameStart.dll"
End If
Label1.Caption = "文件检测完成..."
Wsk1.Connect Ip, Port
DoEvents
lianjie = 5
shijian = 5
Timer1.Enabled = True
End If
End Sub
Private Sub Wsk1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Select Case Number
Case 10060
Label1.Caption = "连接验证服务器失败..."
If MsgBox("连接验证服务器失败,是否继续尝试?", vbApplicationModal + vbDefaultButton2 + vbYesNo + _
vbInformation, App.Title) = vbYes Then
If Wsk1.State <> sckClosed Then Wsk1.Close
Wsk1.Connect Ip, Port
Label1.Caption = "正在连接验证服务器..."
Else
End
End If
End Select
End Sub
Private Sub Wsk1_SendComplete()
Label1.Caption = "认证信息发送完毕,等待验证结果..."
End Sub
Private Sub Wsk1_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
Label1.Caption = "正在发送认证信息..."
End Sub
Private Sub Wsk2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox "未知错误,登陆器无法正常连接验证服务器,请将此错误码报告给GM:B-" & Number
End Sub
'*************************************************************************
'**函 数 名:wsk1_Connect
'**输 入:无
'**输 出:无
'**功能描述:连接成功触发
'**全局变量:
'**调用模块:
'*************************************************************************
Private Sub wsk1_Connect()
On Error GoTo errend
Timer1.Enabled = False
Label1.Caption = "连接验证服务器成功..."
Wsk1.SendData SetMsge(Wsk1.LocalIP, "are you ok?")
DoEvents
Exit Sub
errend:
MsgBox "连接发生错误!数据发送失败!", vbOKOnly + vbExclamation, "TCP 错误信息"
End Sub
Private Sub wsk1_DataArrival(ByVal bytesTotal As Long)
'获得数据
Dim clientDat As String, msg As String
Wsk1.GetData clientDat, vbString
If Len(clientDat) <> 0 Then
Dim strRe() As String
strRe = Split(clientDat, "#$%@#$%@#&&#@")
For i = 0 To UBound(strRe) - 1
msg = Getmsgmsg(strRe(i))
Next
End If
If msg = "OK" Then
Label1.Caption = "验证成功..."
Command5.Enabled = True
Else
Label1.Caption = "验证失败..."
Command5.Enabled = False
End If
End Sub
'*************************************************************************
'**函 数 名:SetMsge
'**输 入:msge(String) -消息类型
'** :msgmsg(String) -消息主体
'"#$%@#$%@#&&#@"-处理并发部分
'**输 出:(String) -
'**功能描述:发送消息的格式
'**全局变量:
'**调用模块:
'*************************************************************************
Public Function SetMsge(msge As String, msgmsg As String) As String
Dim aa As String * 12
aa = msge
SetMsge = aa & msgmsg & "#$%@#$%@#&&#@"
End Function
'**函 数 名:Getmsgmsg
'**输 入:str(String) -
'**输 出:(String) -
'**功能描述:获得消息中的消息主体
'**全局变量:
'**调用模块:
'*************************************************************************
Public Function Getmsgmsg(str As String) As String
'Getmsgmsg = Trim(Mid(str, 13, Len(str) - 12))
Getmsgmsg = Trim(str)
End Function
'*************************************************************************
'**函 数 名:GetMsge
'**输 入:str(String) -
'**输 出:(String) -
'**功能描述:获得消息中的消息类型
'**全局变量:
'**调用模块:
'*************************************************************************
Public Function GetMsge(str As String) As String
GetMsge = Trim(Mid(str, 1, 12))
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -