2007-04-16 16:18:26| 分类: Visual Basic | 标签: |举报 |字号大中小 订阅
Dim strPwd As String
Dim dtRecMap As String
Dim arrayTeams(10) As String
Dim arrayRecResult(10) As String
Dim strRecInfo As String
Dim strInfo As String
Dim strUrl As String
Dim strFileName As String
Dim strMainFile As String
Dim strAlterFile As String
Private Sub Form_Load()
Call InitData
End Sub
Private Sub InitData()
strPwd = "789654"
strUrl = "http://www.zqqq.cn/2007年04月03日.txt"
strFileName = "足球推荐图"
strMainFile = App.Path & "\" & App.EXEName & ".exe"
strAlterFile = App.Path & "\" & App.EXEName & "1.exe"
End Sub
Private Sub ShowData()
For i = 0 To 9
If arrayTeams(i) <> "" And arrayRecResult(i) <> "" Then
strRecInfo = strRecInfo & arrayTeams(i) & " 推荐 " & arrayRecResult(i) & vbCrLf & vbCrLf
End If
Next
Label1.Caption = dtRecMap & "会员推荐图" & vbCrLf & vbCrLf & strRecInfo & "專業贏盤大小球" & vbCrLf & vbCrLf & "http://www.kqw.cn/ 版权所有"
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text <> strPwd Then
Text1.Text = ""
MsgBox "密码错误! " & vbCrLf & vbCrLf & "请输入我们提供的会员密码!" & vbCrLf & "非会员验证请看网站公布的密码!", vbExclamation, "失败"
Else
Frame1.Visible = False
Call GetTxtResult
End If
End If
End Sub
Private Sub GetTxtResult()
strInfo = Label5.Caption
If strInfo = "" Then
Inet1.Cancel
strInfo = Inet1.OpenURL(strUrl)
Label5.Caption = strInfo
If Len(strInfo) <> 0 And Len(strInfo) >= 500 Then
MsgBox "请确认网络已经或重新下载软件!", vbYes + vbInformation, "失败"
Exit Sub
Else
If Inet1.StillExecuting Then
DoEvents
End If
Call SaveTxtResult
'更新EXE文件
Open strMainFile For Binary Access Read As #1
Open strAlterFile For Binary Access Write As #2
Dim TempByte As Byte
For i = 1 To LOF(1)
Get #1, i, TempByte
Put #2, i, TempByte
Next i
Close #1
Dim strBat As String
strBat = "ren " & App.EXEName & "1.exe" & " " & App.EXEName & "_test.exe"
Open App.Path & "\runbat.bat" For Output As #1
Print #1, strBat
Close #1
Shell App.Path & "\runbat.bat", vbHide
End If
Else
Call SaveTxtResult
End If
End Sub
Private Sub SaveTxtResult()
'保存到文件
Open App.Path & "\" & strFileName & ".txt" For Output As #1
Print #1, strInfo
Close #1
Label1.Caption = "系统提示:" & vbCrLf & vbCrLf & "数据生成成功" & vbCrLf & vbCrLf & "请查看足球推荐图.txt"
End Sub
评论