登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

樱之花

叶散的时候,你明白欢聚;花谢的时候,你明白青春.

 
 
 

日志

 
 
关于我

分类中“我的实验室”是我在日常工作中的一些知识总结,有些写的比较匆忙,可能大家在阅读时会产生困扰,后期有时间我会重新整理编辑,谢谢大家的到访,您们的支持是我前进的动力!

一段无聊的代码  

2007-04-16 16:18:26|  分类: Visual Basic |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

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

  评论这张
 
阅读(662)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018