|
@@ -18,17 +18,10 @@ Public Class HX_PGS_UPDATE
|
18
|
18
|
End Sub
|
19
|
19
|
Private Sub IP比對()
|
20
|
20
|
'-----------------------IP比對----------------------------------------------------------------------------------------------------------------------------------------------------
|
21
|
|
- 'For Each myIPEndPoint In IPEndPoint
|
22
|
|
- ' If Strings.Left(myIPEndPoint.Address.ToString, 8) = "172.1.1." Then
|
23
|
|
- ' 伺服器區域_cb.Text = "公司內網" : 內網線路 = True
|
24
|
|
- ' Exit For
|
25
|
|
- ' End If
|
26
|
|
- 'Next
|
27
|
|
- 'If 內網線路 = False And 開發線路 = False Then : 伺服器區域_cb.Text = "公司雲端" : End If
|
28
|
21
|
伺服器區域_cb.Text = "公司雲端"
|
29
|
22
|
End Sub
|
30
|
23
|
Private Sub HX_PGS_UPDATE_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
31
|
|
- IP比對() : 資料數 = 18
|
|
24
|
+ IP比對() : 資料數 = 100
|
32
|
25
|
MyModule1.進度條() : If Strings.Left(伺服器區域_cb.Text, 2) = "公司" Then : SQL_連線字串_正式() : Else : SQL_連線字串_測試() : End If
|
33
|
26
|
MyModule1.進度條() : SQL_FTP伺服器登入位置()
|
34
|
27
|
MyModule1.進度條() : If dr.Read() Then : Target = dr("FTP地址") : FTP帳號 = dr("FTP帳號") : FTP密碼 = dr("FTP密碼") : FTP物理位置 = dr("FTP物理位置") : End If : conn.Close()
|
|
@@ -43,20 +36,119 @@ Public Class HX_PGS_UPDATE
|
43
|
36
|
Private Sub HX_PGS_UPDATE_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
|
44
|
37
|
MyModule1.進度條() : Delay(30000)
|
45
|
38
|
MyModule1.進度條() : Dim Str As String = Application.StartupPath
|
|
39
|
+ '--- 刪除在下載---------------------------------------------------------------------------------------------------------------------------
|
46
|
40
|
MyModule1.進度條() : If File.Exists(Str + "\HX-PGS-ERP-SYS.exe") Then : File.Delete(Str + "\HX-PGS-ERP-SYS.exe") : End If
|
47
|
41
|
MyModule1.進度條() : If File.Exists(Str + "\HX01.docx") Then : File.Delete(Str + "\HX01.docx") : End If
|
48
|
42
|
MyModule1.進度條() : If File.Exists(Str + "\PGS01.docx") Then : File.Delete(Str + "\PGS01.docx") : End If
|
49
|
43
|
MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-ERP-SYS.exe", Str + "\HX-PGS-ERP-SYS.exe")
|
50
|
44
|
MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX01.docx", Str + "\HX01.docx")
|
51
|
45
|
MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "PGS01.docx", Str + "\PGS01.docx")
|
52
|
|
- MyModule1.進度條()
|
53
|
|
- If File.Exists(Str + "\HX-PGS-Message.exe") Then : Else
|
54
|
|
- MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-Message.exe", Str + "\HX-PGS-Message.exe")
|
55
|
|
- End If
|
56
|
|
- MyModule1.進度條()
|
57
|
|
- If File.Exists(Str + "\Tran.exe") Then : Else
|
58
|
|
- MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Tran.exe", Str + "\Tran.exe")
|
59
|
|
- End If
|
|
46
|
+ '--- 比對下載---------------------------------------------------------------------------------------------------------------------------
|
|
47
|
+ MyModule1.進度條() : If File.Exists(Str + "\HX-PGS-Message.exe") Then : Else
|
|
48
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-Message.exe", Str + "\HX-PGS-Message.exe") : End If
|
|
49
|
+ MyModule1.進度條() : If File.Exists(Str + "\Tran.exe") Then : Else
|
|
50
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Tran.exe", Str + "\Tran.exe") : End If
|
|
51
|
+ MyModule1.進度條() : If File.Exists(Str + "\HX-PGS-ERP-SYS.pdb") Then : Else
|
|
52
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-ERP-SYS.pdb", Str + "\HX-PGS-ERP-SYS.pdb") : End If
|
|
53
|
+ MyModule1.進度條() : If File.Exists(Str + "\HX-PGS-ERP-SYS.xml") Then : Else
|
|
54
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-ERP-SYS.xml", Str + "\HX-PGS-ERP-SYS.xml") : End If
|
|
55
|
+ MyModule1.進度條() : If File.Exists(Str + "\Interop.SHDocVw.dll") Then : Else
|
|
56
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Interop.SHDocVw.dll", Str + "\Interop.SHDocVw.dll") : End If
|
|
57
|
+ MyModule1.進度條() : If File.Exists(Str + "\AxInterop.MSHTML.dll") Then : Else
|
|
58
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "AxInterop.MSHTML.dll", Str + "\AxInterop.MSHTML.dll") : End If
|
|
59
|
+ MyModule1.進度條() : If File.Exists(Str + "\AxInterop.SHDocVw.dll") Then : Else
|
|
60
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "AxInterop.SHDocVw.dll", Str + "\AxInterop.SHDocVw.dll") : End If
|
|
61
|
+ MyModule1.進度條() : If File.Exists(Str + "\HX-PGS-ERP-SYS.exe.config") Then : Else
|
|
62
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "HX-PGS-ERP-SYS.exe.config", Str + "\HX-PGS-ERP-SYS.exe.config") : End If
|
|
63
|
+ MyModule1.進度條() : If File.Exists(Str + "\A.txt") Then : Else
|
|
64
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "A.txt", Str + "\A.txt") : End If
|
|
65
|
+ MyModule1.進度條() : If File.Exists(Str + "\C.txt") Then : Else
|
|
66
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "C.txt", Str + "\C.txt") : End If
|
|
67
|
+ MyModule1.進度條() : If File.Exists(Str + "\ch.txt") Then : Else
|
|
68
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "ch.txt", Str + "\ch.txt") : End If
|
|
69
|
+ MyModule1.進度條() : If File.Exists(Str + "\DotNetBarcode.dll") Then : Else
|
|
70
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "DotNetBarcode.dll", Str + "\DotNetBarcode.dll") : End If
|
|
71
|
+ MyModule1.進度條() : If File.Exists(Str + "\en.txt") Then : Else
|
|
72
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "en.txt", Str + "\en.txt") : End If
|
|
73
|
+ MyModule1.進度條() : If File.Exists(Str + "\IdentityModel.dll") Then : Else
|
|
74
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "IdentityModel.dll", Str + "\IdentityModel.dll") : End If
|
|
75
|
+ MyModule1.進度條() : If File.Exists(Str + "\IdentityModel.pdb") Then : Else
|
|
76
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "IdentityModel.pdb", Str + "\IdentityModel.pdb") : End If
|
|
77
|
+ MyModule1.進度條() : If File.Exists(Str + "\IdentityModel.xml") Then : Else
|
|
78
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "IdentityModel.xml", Str + "\IdentityModel.xml") : End If
|
|
79
|
+ MyModule1.進度條() : If File.Exists(Str + "\in.txt") Then : Else
|
|
80
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "in.txt", Str + "\in.txt") : End If
|
|
81
|
+ MyModule1.進度條() : If File.Exists(Str + "\Newtonsoft.Json.dll") Then : Else
|
|
82
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Newtonsoft.Json.dll", Str + "\Newtonsoft.Json.dll") : End If
|
|
83
|
+ MyModule1.進度條() : If File.Exists(Str + "\Newtonsoft.Json.xml") Then : Else
|
|
84
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Newtonsoft.Json.xml", Str + "\Newtonsoft.Json.xml") : End If
|
|
85
|
+ MyModule1.進度條() : If File.Exists(Str + "\PInvoke.Windows.Core.dll") Then : Else
|
|
86
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "PInvoke.Windows.Core.dll", Str + "\PInvoke.Windows.Core.dll") : End If
|
|
87
|
+ MyModule1.進度條() : If File.Exists(Str + "\PInvoke.Windows.Core.xml") Then : Else
|
|
88
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "PInvoke.Windows.Core.xml", Str + "\PInvoke.Windows.Core.xml") : End If
|
|
89
|
+ MyModule1.進度條() : If File.Exists(Str + "\py-tran-log.txt") Then : Else
|
|
90
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "py-tran-log.txt", Str + "\py-tran-log.txt") : End If
|
|
91
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Buffers.dll") Then : Else
|
|
92
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Buffers.dll", Str + "\System.Buffers.dll") : End If
|
|
93
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Buffers.xml") Then : Else
|
|
94
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Buffers.xml", Str + "\System.Buffers.xml") : End If
|
|
95
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Memory.dll") Then : Else
|
|
96
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Memory.dll", Str + "\System.Memory.dll") : End If
|
|
97
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Memory.xml") Then : Else
|
|
98
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Memory.xml", Str + "\System.Memory.xml") : End If
|
|
99
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Numerics.Vectors.dll") Then : Else
|
|
100
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Numerics.Vectors.dll", Str + "\System.Numerics.Vectors.dll") : End If
|
|
101
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Numerics.Vectors.xml") Then : Else
|
|
102
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Numerics.Vectors.xml", Str + "\System.Numerics.Vectors.xml") : End If
|
|
103
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Runtime.CompilerServices.Unsafe.dll") Then : Else
|
|
104
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Runtime.CompilerServices.Unsafe.dll", Str + "\System.Runtime.CompilerServices.Unsafe.dll") : End If
|
|
105
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Runtime.CompilerServices.Unsafe.xml") Then : Else
|
|
106
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Runtime.CompilerServices.Unsafe.xml", Str + "\System.Runtime.CompilerServices.Unsafe.xml") : End If
|
|
107
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Text.Encodings.Web.dll") Then : Else
|
|
108
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Text.Encodings.Web.dll", Str + "\System.Text.Encodings.Web.dll") : End If
|
|
109
|
+ MyModule1.進度條() : If File.Exists(Str + "\System.Text.Encodings.Web.xml") Then : Else
|
|
110
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "System.Text.Encodings.Web.xml", Str + "\System.Text.Encodings.Web.xml") : End If
|
|
111
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadToastNotification.dll") Then : Else
|
|
112
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadToastNotification.dll", Str + "\Telerik.WinControls.RadToastNotification.dll") : End If
|
|
113
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadToastNotification.xml") Then : Else
|
|
114
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadToastNotification.xml", Str + "\Telerik.WinControls.RadToastNotification.xml") : End If
|
|
115
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.SyntaxEditor.dll") Then : Else
|
|
116
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.SyntaxEditor.dll", Str + "\Telerik.WinControls.SyntaxEditor.dll") : End If
|
|
117
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.SyntaxEditor.xml") Then : Else
|
|
118
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.SyntaxEditor.xml", Str + "\Telerik.WinControls.SyntaxEditor.xml") : End If
|
|
119
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadWebCam.dll") Then : Else
|
|
120
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadWebCam.dll", Str + "\Telerik.WinControls.RadWebCam.dll") : End If
|
|
121
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadWebCam.xml") Then : Else
|
|
122
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadWebCam.xml", Str + "\Telerik.WinControls.RadWebCam.xml") : End If
|
|
123
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.GridView.dll") Then : Else
|
|
124
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.GridView.dll", Str + "\Telerik.WinControls.GridView.dll") : End If
|
|
125
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadMap.dll") Then : Else
|
|
126
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadMap.dll", Str + "\Telerik.WinControls.RadMap.dll") : End If
|
|
127
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.RadMap.xml") Then : Else
|
|
128
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.RadMap.xml", Str + "\Telerik.WinControls.RadMap.xml") : End If
|
|
129
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.GridView.xml") Then : Else
|
|
130
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.GridView.xml", Str + "\Telerik.WinControls.GridView.xml") : End If
|
|
131
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.ChartView.dll") Then : Else
|
|
132
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.ChartView.dll", Str + "\Telerik.WinControls.ChartView.dll") : End If
|
|
133
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.ChartView.xml") Then : Else
|
|
134
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.ChartView.xml", Str + "\Telerik.WinControls.ChartView.xml") : End If
|
|
135
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.UI.dll") Then : Else
|
|
136
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.UI.dll", Str + "\Telerik.WinControls.UI.dll") : End If
|
|
137
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.UI.xml") Then : Else
|
|
138
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.UI.xml", Str + "\Telerik.WinControls.UI.xml") : End If
|
|
139
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.dll") Then : Else
|
|
140
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.dll", Str + "\Telerik.WinControls.dll") : End If
|
|
141
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.WinControls.xml") Then : Else
|
|
142
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.WinControls.xml", Str + "\Telerik.WinControls.xml") : End If
|
|
143
|
+ MyModule1.進度條() : If File.Exists(Str + "\TelerikCommon.dll") Then : Else
|
|
144
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "TelerikCommon.dll", Str + "\TelerikCommon.dll") : End If
|
|
145
|
+ MyModule1.進度條() : If File.Exists(Str + "\MediaFoundation.dll") Then : Else
|
|
146
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "MediaFoundation.dll", Str + "\MediaFoundation.dll") : End If
|
|
147
|
+ MyModule1.進度條() : If File.Exists(Str + "\Telerik.Windows.MediaFoundation.dll") Then : Else
|
|
148
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Telerik.Windows.MediaFoundation.dll", Str + "\Telerik.Windows.MediaFoundation.dll") : End If
|
|
149
|
+ MyModule1.進度條() : If File.Exists(Str + "\Microsoft.Toolkit.Uwp.Notifications.dll") Then : Else
|
|
150
|
+ MyModule1.進度條() : My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "Microsoft.Toolkit.Uwp.Notifications.dll", Str + "\Microsoft.Toolkit.Uwp.Notifications.dll") : End If
|
|
151
|
+ '--- 開啟專案---------------------------------------------------------------------------------------------------------------------------
|
60
|
152
|
MyModule1.進度條() : Shell(Str + "\HX-PGS-ERP-SYS.exe", vbNormalFocus)
|
61
|
153
|
Me.Close()
|
62
|
154
|
End Sub
|