|
本帖最后由 xg5699 于 2017-2-26 20:20 编辑
点了更新后
token也是检查过了没问题,家里是上海电信50M的宽带,请问这是什么问题?小精灵里面的代码就是网站下的
- Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
- //界面初始化 释放 BbyUpdater更新文件,并重命名为 BbyUpdater.exe
- Event Form1.Load
- str = string(1024, 0)
- GetModuleFileName 0, str, len(str)
- 程序路径 = Replace(str, split(str, "")(ubound(split(str, ""))), "")
- file1 = 程序路径 & "BbyUpdater.zip"
- file2 = 程序路径 & "BbyUpdater.exe"
- PutAttachment ".", "BbyUpdater.zip"
- Call Plugin.File.ReNameFile(file1, file2)
- End Event
- Event Form1.Button1.Click
-
- fileHandle=Plugin.File.OpenFile(".\access.token") //从云虚拟桌面下载的客户端会自动access.token文件,可以读取后直接访问
- token=Plugin.File.ReadFile(fileHandle,32)
- Call Plugin.File.CloseFile(fileHandle)
- call 文件更新(token,"测试项目","1.0.0.0")
- End Event
- Public Declare Function GetParent Lib "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
- Public Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
- Public Declare Sub rtcDoEvents Lib "msvbvm60.dll" Alias "rtcDoEvents" () As Long
- Function GetCurrentPID()
- Hwnd = Form1.Hwnd
- Do
- hwnd = GetParent(hwnd)
- If hwnd = GetDesktopWindow() or hwnd=0 Then
- hwnd = oldhwnd
- Exit Do
- Else
- oldhwnd=hwnd
- End If
- rtcDoEvents
- Loop
- GetCurrentPID = Plugin.Sy**.GetProcessID(hwnd ) //safasdf
- End Function
- Function 文件更新(token, 项目名称, 版本号)
- //BbyUpdater.exe 进程启动需要附加四个参数
- //token 百宝云对应云应用token
- //progname 百宝云对应云应用代码中的项目名称
- //pid 当前进程的PID,用于更新器,关闭当前进程,如果你是按键精灵,需要获取父级的进程PID,按键精灵具有特殊性
- //version 文件版本号,注意版本号必须为1.0.0.0有格式
-
- str = string(1024, 0)
- GetModuleFileName 0, str, len(str)
- 程序路径 = Replace(str, split(str, "")(ubound(split(str, ""))), "")
- file1 = 程序路径 & "BbyUpdater.exe"
- progname = 项目名称
- pid = GetCurrentPID()
- command = file1 & " " & Chr(34) & token & Chr(34) & " " & Chr(34) & progname & Chr(34) & " " & pid & " " & Chr(34) & 版本号 & Chr(34)
- //MessageBox command
- RunApp command
-
- End Function
复制代码 现在已用大漠获取句柄已经可以正常显示PID了 但是更新进度还是为0 之后跳掉什么也不显示!
|
|