以下是BeforeOpenProject代码:
Dim v As String = FileSys.GetParentPath(e.File) & "\ip.txt"
Dim f As String = FileSys.GetParentPath(e.File) & "\ip0.txt"
If FileSys.FileExists(v) = False Or FileSys.FileExists(f) = False Then
e.Cancel = True
e.HideSplashForm = True
MessageBox.show("文件丢失,无法打开此项目.")
Else
Dim ipdz,IP,s() As String
Dim n As Integer
e.HideSplashForm = True
ipdz = FileSys.ReadAllText(v)
s = ipdz.Split(vbcrlf)
If InputValue(n, "选择网络连接","0:使用内网; 1:使用外网") Then
IP = s(n)
If InputValue(IP,"选择网络连接","请校验IP地址: ") Then
FileSys.WriteAllText(f,IP,False)
If n = 0 Then
RemoteUpdate = False
UpdatePath = "\\bimmo-think\download\jnzy\绩效考核"
Else
RemoteUpdate = True
UpdatePath = “http://127.0.0.1/download/jnzy/绩效考核” ’此处能否用IP
End If
Syscmd.Project.Update(True,True) ’调试采用局域网模式,执行时能提示发现新版本,确认升级后就出现错误
Else
e.Cancel = True
MessageBox.show("用户放弃打开此项目.")
End If
Else
e.Cancel = True
MessageBox.show("用户放弃打开此项目.")
End If
End If