部分程序代码如下:If Dir(App.Path + "\kk.exe") <> "" Then
DeleteFile (App.Path + "\kk.exe")
End If
PBar.Value = 50
Inet1.AccessType = icDirect
Inet1.UserName = User
Inet1.Password = Password
Inet1.Protocol = icFTP
Inet1.Execute ftpserver, "Get kk.exe " + App.Path + "\kk.exe"
PBar.Value = 100
If MsgBox("更新已成功", vbOKOnly) = vbOK Then
End
End If如果我要运行的程序上级目录中有空格就不能正常下载,为什么?
例如我要把服务器上的kk.exe更新到D:\Program Files\kk目录下,就不能更新
如果把中的空格去掉变为D:\ProgramFiles\kk就能正确更新
请教是为什么?
另外,更新的时候,我有的时候能更新有的时候不能更新,这又可能是什么原因?谢谢!
DeleteFile (App.Path + "\kk.exe")
End If
PBar.Value = 50
Inet1.AccessType = icDirect
Inet1.UserName = User
Inet1.Password = Password
Inet1.Protocol = icFTP
Inet1.Execute ftpserver, "Get kk.exe " + App.Path + "\kk.exe"
PBar.Value = 100
If MsgBox("更新已成功", vbOKOnly) = vbOK Then
End
End If如果我要运行的程序上级目录中有空格就不能正常下载,为什么?
例如我要把服务器上的kk.exe更新到D:\Program Files\kk目录下,就不能更新
如果把中的空格去掉变为D:\ProgramFiles\kk就能正确更新
请教是为什么?
另外,更新的时候,我有的时候能更新有的时候不能更新,这又可能是什么原因?谢谢!
FtpGetFile
FtpSetCurrentDirectory
InternetOpen
InternetConnect
InternetCloseHandle
在FtpGetFile参数里面目录可以有空格
Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathName" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
说明
获取指定文件的短路径名
返回值
Long,装载到lpszShortPath缓冲区的字符数量。如lpszShortPath的长度不足,不能容下文件名,就返回需要的缓冲区长度
参数表
参数 类型及说明
lpszLongPath String,指定欲获取短路径名的那个文件的名字。可以是个完整路径,或者由当前目录决定
lpszShortPath String,指定一个缓冲区,用于装载文件的短路径和文件名
cchBuffer Long,lpszShortPath缓冲区长度
你用FtpGetFile,没错的。
拷贝点代码上来,越简单越好,谢谢!
我是初学者