B70340 3 년 전
부모
커밋
9ba96b45da

+ 4
- 0
.editorconfig 파일 보기

1
+[*.vb]
2
+
3
+# BC42353: 函式在所有程式碼路徑上皆不會傳回值
4
+dotnet_diagnostic.BC42353.severity = suggestion

BIN
.vs/TENDEN-MES-SYS/v16/.suo 파일 보기


+ 5
- 0
TENDEN-MES-SYS.sln 파일 보기

5
 MinimumVisualStudioVersion = 10.0.40219.1
5
 MinimumVisualStudioVersion = 10.0.40219.1
6
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "天盾系統", "TENDEN-MES-SYS\天盾系統.vbproj", "{27F7A8C0-0F0B-488C-BECB-5D62C4D74631}"
6
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "天盾系統", "TENDEN-MES-SYS\天盾系統.vbproj", "{27F7A8C0-0F0B-488C-BECB-5D62C4D74631}"
7
 EndProject
7
 EndProject
8
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{93AE1D6D-94FC-47DA-8BEC-07107B605AB0}"
9
+	ProjectSection(SolutionItems) = preProject
10
+		.editorconfig = .editorconfig
11
+	EndProjectSection
12
+EndProject
8
 Global
13
 Global
9
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
14
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
 		Debug|Any CPU = Debug|Any CPU
15
 		Debug|Any CPU = Debug|Any CPU

+ 19
- 12
TENDEN-MES-SYS/LoginForm1vb.vb 파일 보기

34
         '-----------------------控件基本設定-----------------------------------------------------------------------------------------------------------------------------------------------
34
         '-----------------------控件基本設定-----------------------------------------------------------------------------------------------------------------------------------------------
35
         CheckBox1.Enabled = False : CheckBox1.Enabled = False : TextBox4.Text = "1" : Label1.Text = "執行檔版本號 : " & 版本 : UsernameTextBox.ImeMode = 3
35
         CheckBox1.Enabled = False : CheckBox1.Enabled = False : TextBox4.Text = "1" : Label1.Text = "執行檔版本號 : " & 版本 : UsernameTextBox.ImeMode = 3
36
         網段.ShowDialog()
36
         網段.ShowDialog()
37
-        If 登入判斷 = True Then
38
-            ComboBox1.Text = "天盾伺服器"
39
-            OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
40
-        ElseIf 登入判斷 = False Then
41
-            ComboBox1.Text = "雲端伺服器"
42
-            OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
43
-        End If
44
         '-----------------------調整視窗大小-----------------------------------------------------------------------------------------------------------------------------------------------
37
         '-----------------------調整視窗大小-----------------------------------------------------------------------------------------------------------------------------------------------
45
         Me.Size = New Size(470, 288)
38
         Me.Size = New Size(470, 288)
46
         If screenWidth = 1920 And screenHeight = 1080 Then : Me.Location = New Point(725, 396)
39
         If screenWidth = 1920 And screenHeight = 1080 Then : Me.Location = New Point(725, 396)
51
         End If
44
         End If
52
         Timer1.Enabled = True
45
         Timer1.Enabled = True
53
     End Sub
46
     End Sub
47
+    Private Sub LoginForm1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
48
+        If 登入判斷 = True Then
49
+            ComboBox1.Text = "天盾伺服器"
50
+            OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
51
+        ElseIf 登入判斷 = False Then
52
+            ComboBox1.Text = "雲端伺服器"
53
+            OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
54
+        End If
55
+    End Sub
54
     Private Sub 登入()
56
     Private Sub 登入()
55
         '-----------------------寫入連線字串-----------------------------------------------------------------------------------------------------------------------------------------------
57
         '-----------------------寫入連線字串-----------------------------------------------------------------------------------------------------------------------------------------------
56
         If ComboBox1.Text = "雲端伺服器" Then
58
         If ComboBox1.Text = "雲端伺服器" Then
97
     Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
99
     Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
98
         '-----------------------確認登入伺服器位置-----------------------------------------------------------------------------------------------------------------------------------------
100
         '-----------------------確認登入伺服器位置-----------------------------------------------------------------------------------------------------------------------------------------
99
         If ComboBox1.Text = "天盾伺服器" Then
101
         If ComboBox1.Text = "天盾伺服器" Then
100
-            登入人IP = "192.168.0.107"
101
-            登入()
102
-            OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
102
+            If SQL_連線狀態模組.ConnectTest("192.168.0.107") = True Then
103
+                登入人IP = "192.168.0.107" : 登入()
104
+                OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
105
+            Else
106
+                MsgBox("天盾伺服器無法連線,自動轉跳測試線路,請聯繫系統管理員!!")
107
+                ComboBox1.Text = "雲端伺服器"
108
+                登入人IP = "106.1.48.106,4567" : 登入()
109
+                OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
110
+            End If
103
         ElseIf ComboBox1.Text = "雲端伺服器" Then
111
         ElseIf ComboBox1.Text = "雲端伺服器" Then
104
-            登入人IP = "106.1.48.106,4567"
105
-            登入()
112
+            登入人IP = "106.1.48.106,4567" : 登入()
106
             OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
113
             OK.Enabled = True : Cancel.Enabled = True : CheckBox1.Checked = True
107
         End If
114
         End If
108
         UsernameTextBox.Focus()
115
         UsernameTextBox.Focus()

+ 65
- 0
TENDEN-MES-SYS/Module/SQL_連線狀態模組.vb 파일 보기

1
+Module SQL_連線狀態模組
2
+#Region "——连接测试:避免等待时间过长——"
3
+    Dim bConnect As Boolean
4
+    Dim BgWorker1 As New System.ComponentModel.BackgroundWorker
5
+    Dim ServerIP As String
6
+    ''' <summary>
7
+    ''' 测试连接:True-连接成功,False-连接失败
8
+    ''' 参数[必选]:服务器IP
9
+    ''' 参数[可选]:等待超时时间(秒),默认为1.2秒
10
+    ''' </summary>
11
+    ''' <returns></returns>
12
+    ''' <remarks></remarks>
13
+    Function ConnectTest(ByVal varServerIP As String, Optional ByVal varTimeout As Decimal = 3) As Boolean
14
+        AddHandler BgWorker1.DoWork, AddressOf BgWorker1_DoWork
15
+        Dim g As Integer
16
+        Dim k As Integer
17
+        If BgWorker1.CancellationPending Then
18
+            BgWorker1.CancelAsync()
19
+            '取消BackgroundWorker執行中的工作
20
+        End If
21
+        Try
22
+            If varServerIP = "" Then
23
+                Exit Function
24
+            End If
25
+            ServerIP = varServerIP
26
+            If varTimeout <= 0 Then
27
+                varTimeout = 3
28
+            End If
29
+            k = Int(varTimeout * 10)
30
+            bConnect = False
31
+            BgWorker1.WorkerSupportsCancellation = True
32
+            BgWorker1.RunWorkerAsync()
33
+            For g = 1 To k '1.2s
34
+                Threading.Thread.Sleep(100)
35
+                If bConnect = True Then
36
+                    ConnectTest = True
37
+                    Exit Function
38
+                End If
39
+            Next
40
+            ConnectTest = False
41
+            BgWorker1.CancelAsync()
42
+        Catch ex As Exception
43
+            MsgBox(ex.Message)
44
+        End Try
45
+    End Function
46
+    '--异步动作
47
+    Private Sub BgWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
48
+        Call ConnectMSSQLServer()
49
+    End Sub
50
+    '--连接数据库
51
+    Private Function ConnectMSSQLServer() As Boolean
52
+        Dim sqlConTest As Data.SqlClient.SqlConnection ' 连接   
53
+        sqlConTest = New Data.SqlClient.SqlConnection
54
+        sqlConTest.ConnectionString = "Data Source=" + ServerIP + ";Initial Catalog=天盾國際管理系統資料庫;Persist Security Info=True;User ID=b70340;Password=0911274990;Max pool size = 200;Connection Timeout=0"
55
+        Try
56
+            sqlConTest.Open()
57
+            sqlConTest.Close()
58
+        Catch ex As Exception
59
+        Finally
60
+            bConnect = True
61
+        End Try
62
+    End Function
63
+#End Region
64
+End Module
65
+

BIN
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe 파일 보기


BIN
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb 파일 보기


+ 9
- 0
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.xml 파일 보기

232
   查詢類型 System.Drawing.Bitmap 的當地語系化資源。
232
   查詢類型 System.Drawing.Bitmap 的當地語系化資源。
233
 </summary>
233
 </summary>
234
 </member>
234
 </member>
235
+<member name="M:天盾國際管理系統.SQL_連線狀態模組.ConnectTest(System.String,System.Decimal)">
236
+ <summary>
237
+ 测试连接:True-连接成功,False-连接失败
238
+ 参数[必选]:服务器IP
239
+ 参数[可选]:等待超时时间(秒),默认为1.2秒
240
+ </summary>
241
+ <returns></returns>
242
+ <remarks></remarks>
243
+</member>
235
 </members>
244
 </members>
236
 </doc>
245
 </doc>

BIN
TENDEN-MES-SYS/obj/Debug/DesignTimeResolveAssemblyReferences.cache 파일 보기


BIN
TENDEN-MES-SYS/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache 파일 보기


BIN
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe 파일 보기


BIN
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb 파일 보기


+ 9
- 0
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.xml 파일 보기

232
   查詢類型 System.Drawing.Bitmap 的當地語系化資源。
232
   查詢類型 System.Drawing.Bitmap 的當地語系化資源。
233
 </summary>
233
 </summary>
234
 </member>
234
 </member>
235
+<member name="M:天盾國際管理系統.SQL_連線狀態模組.ConnectTest(System.String,System.Decimal)">
236
+ <summary>
237
+ 测试连接:True-连接成功,False-连接失败
238
+ 参数[必选]:服务器IP
239
+ 参数[可选]:等待超时时间(秒),默认为1.2秒
240
+ </summary>
241
+ <returns></returns>
242
+ <remarks></remarks>
243
+</member>
235
 </members>
244
 </members>
236
 </doc>
245
 </doc>

+ 1
- 1
TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.CoreCompileInputs.cache 파일 보기

1
-84eb73d2d4c30da277b562d207fe0f6ae09feec2
1
+faf913a810261d1ca276697c3a73648b9bc8c807

BIN
TENDEN-MES-SYS/obj/Debug/天盾系統.vbprojAssemblyReference.cache 파일 보기


+ 4
- 0
TENDEN-MES-SYS/天盾系統.vbproj 파일 보기

103
     <Compile Include="Module\SQL_人事系統管理.vb" />
103
     <Compile Include="Module\SQL_人事系統管理.vb" />
104
     <Compile Include="Module\SQL_成本系統管理.vb" />
104
     <Compile Include="Module\SQL_成本系統管理.vb" />
105
     <Compile Include="Module\SQL_資料庫系統管理.vb" />
105
     <Compile Include="Module\SQL_資料庫系統管理.vb" />
106
+    <Compile Include="Module\SQL_連線狀態模組.vb" />
106
     <Compile Include="Module\SQL_量產訂單資料庫切換.vb" />
107
     <Compile Include="Module\SQL_量產訂單資料庫切換.vb" />
107
     <Compile Include="Module\SQL_圖片資料庫管理.vb" />
108
     <Compile Include="Module\SQL_圖片資料庫管理.vb" />
108
     <Compile Include="Module\SQL_彙總報表管理.vb" />
109
     <Compile Include="Module\SQL_彙總報表管理.vb" />
1074
     </EmbeddedResource>
1075
     </EmbeddedResource>
1075
   </ItemGroup>
1076
   </ItemGroup>
1076
   <ItemGroup>
1077
   <ItemGroup>
1078
+    <None Include="..\.editorconfig">
1079
+      <Link>.editorconfig</Link>
1080
+    </None>
1077
     <None Include="My Project\Application.myapp">
1081
     <None Include="My Project\Application.myapp">
1078
       <Generator>MyApplicationCodeGenerator</Generator>
1082
       <Generator>MyApplicationCodeGenerator</Generator>
1079
       <LastGenOutput>Application.Designer.vb</LastGenOutput>
1083
       <LastGenOutput>Application.Designer.vb</LastGenOutput>

Loading…
취소
저장