Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SYS-UPDATE.vb 1.3KB

123456789101112131415161718192021222324
  1. Imports System.IO
  2. Public Class SYS_UPDATE
  3. ReadOnly ds2 As New DataSet
  4. Private Sub SYS_UPDATE_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5. '-----------------------寫入連線字串-----------------------------------------------------------------------------------------------------------------------------------------------
  6. 資料數 = 5
  7. Target = "https://gcm-smart.com/ERP/GCM-ERP/"
  8. End Sub
  9. Private Sub SYS_UPDATE_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  10. MyModule1.進度條() : Delay(30000)
  11. MyModule1.進度條() : Dim Str As String = Application.StartupPath
  12. MyModule1.進度條() : If File.Exists(Str + "\GCM-ERP-SYS.exe") Then : File.Delete(Str + "\GCM-ERP-SYS.exe") : End If
  13. MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & "GCM-ERP-SYS.exe", Str + "\GCM-ERP-SYS.exe")
  14. MyModule1.進度條() : Shell(Str + "\GCM-ERP-SYS.exe", vbNormalFocus)
  15. Me.Close()
  16. End Sub
  17. Public Sub Delay(ByRef Interval As Double) 'Interval单位为毫秒
  18. Dim time As DateTime = DateTime.Now
  19. Dim Span As Double = Interval * 1234
  20. While ((DateTime.Now.Ticks - time.Ticks) < Span)
  21. Application.DoEvents()
  22. End While
  23. End Sub
  24. End Class