希望能提供详细代码,谢谢!我会给高分的
3 个解决方案
#1
各位高手帮帮忙,本人只有这么多分能用了,请原谅,还望高手指点啊
#2
应该用Winsock而不是Inet
#3
Private Function UpdateSorce() As Boolean
Dim gPath As String
Dim gPath1 As String
Dim dDate As Date
dDate = Now
Update.URL = "ftp://192.168.5.11"
Update.UserName = "update"
Update.PassWord = "zztmzztm"
ViewPath = "D:\View\"
ImagePath = "D:\Image\"
If Dir(ViewPath, vbDirectory) = "" And Dir(ImagePath, vbDirectory) = "" Then
MkDir ImagePath
MkDir ViewPath
End If
gPath = "get \View\zhou.jpg " & ViewPath & "\zhou.jpg"
' gPath1 = "get \BusCom10000.exe " & ImagePath & "\BusCom10000.exe"
Update.Execute , gPath
Do While Update.StillExecuting
DoEvents
If (DateDiff("s", dDate, Now) > 30) Then
MsgBox "更新资源出现问题,请断开防火墙重试...", vbCritical, "提示..."
Unload Me
End
End If
Loop
Name gPath & "zhou.jpg" As ViewPath & "\zhou.jpg"
' Name gPath1 & "BusCom10000.exe" As ImagePath & "\BusCom10000.exe"
MsgBox "更新程序成功!点击[确定]后启动新程序", vbInformation, "提示..."
Unload Me
End
Exit Function
err:
If err.Number <> 58 Then
MsgBox "更新资源失败,请联系系统管理员!" & vbCrLf & err.Description, vbCritical, "提示..."
Else
MsgBox " 程序已经运行,本次运行的程序将会自动退出", vbCritical
End If
Unload Me
End Function
Dim gPath As String
Dim gPath1 As String
Dim dDate As Date
dDate = Now
Update.URL = "ftp://192.168.5.11"
Update.UserName = "update"
Update.PassWord = "zztmzztm"
ViewPath = "D:\View\"
ImagePath = "D:\Image\"
If Dir(ViewPath, vbDirectory) = "" And Dir(ImagePath, vbDirectory) = "" Then
MkDir ImagePath
MkDir ViewPath
End If
gPath = "get \View\zhou.jpg " & ViewPath & "\zhou.jpg"
' gPath1 = "get \BusCom10000.exe " & ImagePath & "\BusCom10000.exe"
Update.Execute , gPath
Do While Update.StillExecuting
DoEvents
If (DateDiff("s", dDate, Now) > 30) Then
MsgBox "更新资源出现问题,请断开防火墙重试...", vbCritical, "提示..."
Unload Me
End
End If
Loop
Name gPath & "zhou.jpg" As ViewPath & "\zhou.jpg"
' Name gPath1 & "BusCom10000.exe" As ImagePath & "\BusCom10000.exe"
MsgBox "更新程序成功!点击[确定]后启动新程序", vbInformation, "提示..."
Unload Me
End
Exit Function
err:
If err.Number <> 58 Then
MsgBox "更新资源失败,请联系系统管理员!" & vbCrLf & err.Description, vbCritical, "提示..."
Else
MsgBox " 程序已经运行,本次运行的程序将会自动退出", vbCritical
End If
Unload Me
End Function
#1
各位高手帮帮忙,本人只有这么多分能用了,请原谅,还望高手指点啊
#2
应该用Winsock而不是Inet
#3
Private Function UpdateSorce() As Boolean
Dim gPath As String
Dim gPath1 As String
Dim dDate As Date
dDate = Now
Update.URL = "ftp://192.168.5.11"
Update.UserName = "update"
Update.PassWord = "zztmzztm"
ViewPath = "D:\View\"
ImagePath = "D:\Image\"
If Dir(ViewPath, vbDirectory) = "" And Dir(ImagePath, vbDirectory) = "" Then
MkDir ImagePath
MkDir ViewPath
End If
gPath = "get \View\zhou.jpg " & ViewPath & "\zhou.jpg"
' gPath1 = "get \BusCom10000.exe " & ImagePath & "\BusCom10000.exe"
Update.Execute , gPath
Do While Update.StillExecuting
DoEvents
If (DateDiff("s", dDate, Now) > 30) Then
MsgBox "更新资源出现问题,请断开防火墙重试...", vbCritical, "提示..."
Unload Me
End
End If
Loop
Name gPath & "zhou.jpg" As ViewPath & "\zhou.jpg"
' Name gPath1 & "BusCom10000.exe" As ImagePath & "\BusCom10000.exe"
MsgBox "更新程序成功!点击[确定]后启动新程序", vbInformation, "提示..."
Unload Me
End
Exit Function
err:
If err.Number <> 58 Then
MsgBox "更新资源失败,请联系系统管理员!" & vbCrLf & err.Description, vbCritical, "提示..."
Else
MsgBox " 程序已经运行,本次运行的程序将会自动退出", vbCritical
End If
Unload Me
End Function
Dim gPath As String
Dim gPath1 As String
Dim dDate As Date
dDate = Now
Update.URL = "ftp://192.168.5.11"
Update.UserName = "update"
Update.PassWord = "zztmzztm"
ViewPath = "D:\View\"
ImagePath = "D:\Image\"
If Dir(ViewPath, vbDirectory) = "" And Dir(ImagePath, vbDirectory) = "" Then
MkDir ImagePath
MkDir ViewPath
End If
gPath = "get \View\zhou.jpg " & ViewPath & "\zhou.jpg"
' gPath1 = "get \BusCom10000.exe " & ImagePath & "\BusCom10000.exe"
Update.Execute , gPath
Do While Update.StillExecuting
DoEvents
If (DateDiff("s", dDate, Now) > 30) Then
MsgBox "更新资源出现问题,请断开防火墙重试...", vbCritical, "提示..."
Unload Me
End
End If
Loop
Name gPath & "zhou.jpg" As ViewPath & "\zhou.jpg"
' Name gPath1 & "BusCom10000.exe" As ImagePath & "\BusCom10000.exe"
MsgBox "更新程序成功!点击[确定]后启动新程序", vbInformation, "提示..."
Unload Me
End
Exit Function
err:
If err.Number <> 58 Then
MsgBox "更新资源失败,请联系系统管理员!" & vbCrLf & err.Description, vbCritical, "提示..."
Else
MsgBox " 程序已经运行,本次运行的程序将会自动退出", vbCritical
End If
Unload Me
End Function