No Description
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.

登入畫面.vb 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. Imports System.IO
  2. Imports System.Text
  3. Public Class 登入畫面
  4. Dim MACKK, diskId, diskSerialNumber, diskModel As String 'MAC碼
  5. Dim Str As String = Application.StartupPath
  6. Dim IP公, IP測1, IP測2, 印尼測試內網網段 As Boolean
  7. Dim FFGG, GGHH As Integer
  8. ReadOnly 對話框(15) As String
  9. ReadOnly ds2, ds3 As New DataSet
  10. Private Sub 登入畫面_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  11. Dim strDirNam As String = Path.Combine(Application.StartupPath, "GF00-ERP-UPDATE.EXE")
  12. If File.Exists(strDirNam) Then : File.Delete(strDirNam) : End If
  13. 執行檔版本號_lb.Text = "執行檔版本號 : " & 版本
  14. 'Timer1.Enabled = True
  15. IP公 = False : IP測1 = False : IP測2 = False ': Panel1.SendToBack()
  16. 系統登入_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
  17. '-----------------------控件基本設定-----------------------------------------------------------------------------------------------------------------------------------------------
  18. 深色風格_ch.Visible = 風格啟用 : 系統語言_cb.Visible = 多國語言啟用 : 系統語言_lb.Visible = 多國語言啟用
  19. If 多國語言啟用 = False Then : 系統語言 = "繁體中文" : End If : 廟 = False
  20. 公司線路_rb.Visible = 測試線路啟用 : 測試線路_rb.Visible = 測試線路啟用
  21. 刷卡登入_ch.Checked = True : 登入綁定_ch.Checked = False : 公司線路_rb.Checked = True
  22. 刷卡登入_ch.Visible = False : 登入綁定_ch.Visible = False : Panel1.SendToBack()
  23. If 風格啟用 = True Then
  24. Dim filePath As String = Path.Combine(Application.StartupPath, "HXSTYLE.txt")
  25. If File.Exists(filePath) Then
  26. Dim filereader = My.Computer.FileSystem.OpenTextFileReader(filePath, System.Text.Encoding.Default)
  27. Dim Text As String = "" : Dim line As String = filereader.ReadLine()
  28. While Not (line Is Nothing) : Text = Text & line & vbCrLf : line = filereader.ReadLine() : End While : filereader.Close()
  29. If Strings.Left(Text, 1) = "B" Then : 深色風格_ch.Checked = False : 深色風格 = False
  30. ElseIf Strings.Left(Text, 1) = "W" Then : 深色風格_ch.Checked = True : 深色風格 = True : End If
  31. Else : 深色風格_ch.Checked = False : 深色風格 = False : End If
  32. 風格()
  33. End If
  34. Dim filePath1 As String = Path.Combine(Application.StartupPath, "TEST.txt")
  35. If File.Exists(filePath1) Then
  36. Dim fileContent As String = File.ReadAllText(Str + "\TEST.txt")
  37. txt = fileContent
  38. If fileContent.Length >= 10 AndAlso fileContent(2) = "G" AndAlso fileContent(9) = "F" Then
  39. Dim databaseID As String = fileContent(4) & fileContent(7)
  40. 資料庫編號 = databaseID
  41. Else
  42. MGB("錯誤,請通知系管理員", 1) : Me.Close()
  43. End If
  44. Else
  45. 輸入密碼.ShowDialog()
  46. If PA = "0003065795" Then
  47. PA = InputBox("請輸入啟動碼!!", "啟用系統")
  48. Dim strDirName As String : Dim filePath2 As String = Path.Combine(Application.StartupPath, "TEST.txt")
  49. If File.Exists(filePath2) Then : File.Delete(filePath2) : End If
  50. strDirName = filePath2
  51. Try
  52. Using fs As IO.FileStream = New IO.FileStream(strDirName, FileMode.Append)
  53. Using sw As StreamWriter = New StreamWriter(fs, Encoding.Default)
  54. Dim str As String = PA
  55. sw.WriteLine(str) '插入一整行
  56. sw.Flush()
  57. End Using
  58. End Using
  59. Catch ex As Exception
  60. End Try
  61. Application.Restart()
  62. Else : MGB("驗證碼錯誤", 1) : Me.Close() : End If
  63. End If
  64. '-----------------------調整視窗大小-----------------------------------------------------------------------------------------------------------------------------------------------
  65. Me.Size = New Size(460, 280)
  66. Dim screenBounds As Rectangle = Screen.PrimaryScreen.Bounds
  67. Me.Left = (screenBounds.Width - Me.Width) / 2
  68. Me.Top = (screenBounds.Height - Me.Height) / 2
  69. '-----MAC碼與硬碟資料-------------------------------------------------------------------------------------------------------------------------------------------------------------
  70. Dim Wmi As New Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")
  71. For Each WmiObj As Management.ManagementObject In Wmi.Get
  72. If CBool(WmiObj("IPEnabled")) Then
  73. MACKK = WmiObj("MACAddress")
  74. End If
  75. Next
  76. Dim cmicWmi As New Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
  77. For Each cmicWmiObj As Management.ManagementObject In cmicWmi.Get
  78. diskId = cmicWmiObj("size")
  79. diskSerialNumber = cmicWmiObj("serialnumber")
  80. diskModel = cmicWmiObj("Model")
  81. Exit For
  82. Next
  83. '-----電腦預設值------------------------------------------------------------------------------------------------------------------------------------------------------------------
  84. SQL_連線字串_本機()
  85. 電腦識別碼 = diskId & "_" & diskSerialNumber & "_" & diskModel : 電腦識別碼 = Replace(電腦識別碼, "'", "_")
  86. SQL_電腦預設值查詢() : 帳號_rtb.ImeMode = 2
  87. '-----不啟用WEB------------------------------------------------------------------------------------------------------------------------------------------------------------------
  88. Dim filePath3 As String = Path.Combine(Application.StartupPath, "NOPWEB.txt")
  89. If File.Exists(filePath3) Then
  90. Dim filereader = My.Computer.FileSystem.OpenTextFileReader(Str + "\NOPWEB.txt", System.Text.Encoding.Default)
  91. Dim Text As String = "" : Dim line As String = filereader.ReadLine()
  92. While Not (line Is Nothing) : Text = Text & line & vbCrLf : line = filereader.ReadLine() : End While : filereader.Close()
  93. If Strings.Left(Text, 2) = "NO" Then : 不啟用WEB_cb.Checked = False
  94. ElseIf Strings.Left(Text, 3) = "YES" Then : 不啟用WEB_cb.Checked = True : End If
  95. Else : 不啟用WEB_cb.Checked = False : End If
  96. If 不啟用WEB_cb.Checked = False Then : 不用WEB = False : Else : 不用WEB = True : End If
  97. PA49 = "mssql-147629-0.cloudclusters.net,12711"
  98. IP公 = True : IP測1 = True : IP測2 = True : 伺服器區域_cb.Text = "正式" : 公司線路_rb.Checked = True : 測試線路_rb.Checked = False : 內網線路 = True
  99. 確定_rbt.Enabled = True : 取消_rbt.Enabled = True : 刷卡登入_ch.Checked = True
  100. 'IP比對()
  101. SQL_系統版本號驗證()
  102. If dr.Read() Then : 資料庫版本 = dr("系統認證版本號") : 版本號 = dr("系統認證版本號") : End If : conn.Close()
  103. If Strings.Right(執行檔版本號_lb.Text, 10) <> Strings.Right(資料庫版本號_lb.Text, 10) Then
  104. 登入() : 自動更新2()
  105. Else : End If
  106. End Sub
  107. Private Function ScaleImage(ByVal img As Image, ByVal size As Size) As Image
  108. Dim newImage As New Bitmap(size.Width, size.Height)
  109. Using graphics As Graphics = Graphics.FromImage(newImage)
  110. graphics.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
  111. graphics.DrawImage(img, New Rectangle(0, 0, size.Width, size.Height))
  112. End Using
  113. Return newImage
  114. End Function
  115. Private Sub IP比對()
  116. If SQL_連線狀態模組1.ConnectTest1("mssql-147629-0.cloudclusters.net,12711") = True Then
  117. '---主伺服器導通-------------------------------------------
  118. PA49 = "mssql-147629-0.cloudclusters.net,12711"
  119. IP公 = True : IP測1 = True : IP測2 = True : 伺服器區域_cb.Text = "正式" : 公司線路_rb.Checked = True : 測試線路_rb.Checked = False : 內網線路 = True
  120. 確定_rbt.Enabled = True : 取消_rbt.Enabled = True : 刷卡登入_ch.Checked = True
  121. Else
  122. If SQL_連線狀態模組2.ConnectTest2("106.1.48.106,4567") = True Then
  123. '---主伺服器導通-------------------------------------------
  124. 對話框(1) = "正式資料庫無法連線,請通知系統管理員!!"
  125. MGB(對話框(1), 1)
  126. PA49 = "106.1.48.106,4567"
  127. IP公 = True : IP測1 = True : IP測2 = True : 伺服器區域_cb.Text = "測試" : 公司線路_rb.Checked = True : 測試線路_rb.Checked = False : 內網線路 = True
  128. 確定_rbt.Enabled = True : 取消_rbt.Enabled = True : 刷卡登入_ch.Checked = True
  129. Else
  130. 對話框(1) = "正式及測試資料庫皆無法連線,請通知系統管理員!!"
  131. MGB(對話框(1), 1) : Me.Close()
  132. End If
  133. End If
  134. End Sub
  135. Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 伺服器區域_cb.SelectedIndexChanged
  136. '-----------------------確認登入伺服器位置-----------------------------------------------------------------------------------------------------------------------------------------
  137. If 伺服器區域_cb.Text = "正式" Then
  138. If IP公 = True Then : 登入人IP = "mssql-147629-0.cloudclusters.net,12711"
  139. 登入() : 確定_rbt.Enabled = True : 取消_rbt.Enabled = True : 刷卡登入_ch.Checked = True
  140. Dim filePath As String = Path.Combine(Application.StartupPath, "NOTAUTO.txt")
  141. If File.Exists(filePath) Then : Me.Text = "GF" & 資料庫編號 & "-ERP-SYS Line : M " : Else : Me.Text = "GF" & 資料庫編號 & "-ERP-SYS Line : M" : End If
  142. Else : MGB(對話框(11), 1) : Me.Close() : End If
  143. ElseIf 伺服器區域_cb.Text = "測試" Then
  144. If IP公 = True Then : 登入人IP = "mssql-147629-0.cloudclusters.net,12711" : 資料庫編號 = "99"
  145. 登入() : 確定_rbt.Enabled = True : 取消_rbt.Enabled = True : 刷卡登入_ch.Checked = True
  146. Dim filePath As String = Path.Combine(Application.StartupPath, "NOTAUTO.txt")
  147. If File.Exists(filePath) Then : Me.Text = "GF" & 資料庫編號 & "-ERP-SYS Line : T " : Else : Me.Text = "GF" & 資料庫編號 & "-ERP-SYS Line : T" : End If
  148. Else : MGB(對話框(11), 1) : Me.Close() : End If
  149. End If : 帳號_rtb.Focus()
  150. End Sub
  151. Private Sub 登入()
  152. '-----------------------寫入連線字串-----------------------------------------------------------------------------------------------------------------------------------------------
  153. If Strings.Left(伺服器區域_cb.Text, 2) = "正式" Or Strings.Left(伺服器區域_cb.Text, 2) = "正式" Then : SQL_連線字串_正式() : Else : SQL_連線字串_正式() : End If
  154. 驗證_tb.Text = "1" : g_conn_type = 伺服器區域_cb.Text & "伺服器"
  155. '-----------------------系統是否鎖定-----------------------------------------------------------------------------------------------------------------------------------------------
  156. SQL_讀取鎖定()
  157. If dr.Read() Then
  158. Dim ch As Boolean = dr("系統鎖定") : If ch = True Then : 退出.ShowDialog() : 退出.BringToFront() : Return : End If
  159. End If : conn.Close()
  160. '-----------------------讀取圖片------------
  161. SQL_取得登入圖檔()
  162. While dr.Read() = True
  163. Dim unused As Byte() = New Byte(-1) {}
  164. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  165. Dim oStream As New MemoryStream(bytes)
  166. PictureBox1.Image = Bitmap.FromStream(oStream)
  167. End While
  168. '-----------------------系統版本號寫入-----------------------------------------------------------------------------------------------------------------------------------------------
  169. SQL_系統版本號驗證()
  170. If dr.Read() Then : 資料庫版本 = dr("系統認證版本號") : 版本號 = dr("系統認證版本號") : End If : conn.Close()
  171. '-----------------------FTP資料夾登入位置宣告--------------------------------------------------------------------------------------------------------------------------------------
  172. SQL_FTP伺服器登入位置()
  173. If dr.Read() Then
  174. Target = dr("FTP地址") : FTP帳號 = dr("FTP帳號") : FTP密碼 = dr("FTP密碼") : FTP物理位置 = dr("FTP物理位置")
  175. End If : conn.Close()
  176. Set_清單1()
  177. Dim HH As String
  178. For i As Integer = 0 To ftp清單_dgv.Rows.Count - 1
  179. If i < 10 Then : HH = "0" & i : ElseIf i >= 10 Then : HH = i : End If
  180. If ftp清單_dgv("指定", i).Value.ToString = "AA" & HH Then : AA(i) = ftp清單_dgv("資料夾名稱", i).Value.ToString : End If
  181. Next
  182. If 多國語言啟用 = True Then : Else : 語言轉換讀取() : 資料庫版本號_lb.Text = "資料庫版本號 : " & 資料庫版本 : End If
  183. '-----MAC碼與硬碟資料-------------------------------------------------------------------------------------------------------------------------------------------------------------
  184. Dim Wmi As New Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")
  185. For Each WmiObj As Management.ManagementObject In Wmi.Get
  186. If CBool(WmiObj("IPEnabled")) Then : MACKK = WmiObj("MACAddress") : End If
  187. Next
  188. Dim cmicWmi As New Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
  189. For Each cmicWmiObj As Management.ManagementObject In cmicWmi.Get
  190. diskId = cmicWmiObj("size")
  191. diskSerialNumber = cmicWmiObj("serialnumber")
  192. diskModel = cmicWmiObj("Model")
  193. Exit For
  194. Next
  195. End Sub
  196. Private Sub ConnectToDatabase()
  197. SQL_系統版本號驗證() : If dr.Read() Then : 資料庫版本 = dr("系統認證版本號") : 版本號 = dr("系統認證版本號") : End If : conn.Close()
  198. End Sub
  199. Private Sub Set_清單1()
  200. ftp清單_dgv.DataSource = Nothing : ds2.Clear()
  201. ftp清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  202. ftp清單_dgv.ColumnHeadersHeight = 25 : ftp清單_dgv.AllowUserToAddRows = False
  203. SQL_FTP資料夾路徑分配()
  204. da.Fill(ds2) : ftp清單_dgv.DataSource = ds2.Tables(0) : conn.Close()
  205. End Sub
  206. Private Sub 自動更新2()
  207. Dim filePath As String = Path.Combine(Application.StartupPath, "NOTAUTO.txt")
  208. If File.Exists(filePath) Then
  209. If 帳號_rtb.Text = "b70340" Or 帳號_rtb.Text = "B70340" Then : Else : End If
  210. Else
  211. SQL_系統認證版本號查詢()
  212. If dr.Read() Then
  213. If Strings.Right(執行檔版本號_lb.Text, 10) = dr("小更新1").ToString Or Strings.Right(執行檔版本號_lb.Text, 10) = dr("小更新2").ToString Or
  214. Strings.Right(執行檔版本號_lb.Text, 10) = dr("小更新3").ToString Or Strings.Right(執行檔版本號_lb.Text, 10) = dr("小更新4").ToString Or
  215. Strings.Right(執行檔版本號_lb.Text, 10) = dr("小更新5").ToString Then : PA = "1"
  216. ElseIf Strings.Right(執行檔版本號_lb.Text, 10) = dr("中更新1").ToString Or Strings.Right(執行檔版本號_lb.Text, 10) = dr("中更新2").ToString Or
  217. Strings.Right(執行檔版本號_lb.Text, 10) = dr("中更新3").ToString Or Strings.Right(執行檔版本號_lb.Text, 10) = dr("中更新4").ToString Or
  218. Strings.Right(執行檔版本號_lb.Text, 10) = dr("中更新5").ToString Then : PA = "2"
  219. Else : PA = "3" : End If
  220. End If : conn.Close() : PA = "1"
  221. Dim strDirName As String : filePath = Path.Combine(Application.StartupPath, "GF00UPDATE.txt")
  222. If File.Exists(filePath) Then : File.Delete(filePath) : End If
  223. strDirName = filePath
  224. Try
  225. Using fs As IO.FileStream = New IO.FileStream(strDirName, FileMode.Append)
  226. Using sw As StreamWriter = New StreamWriter(fs, Encoding.Default)
  227. Dim strd As String = PA
  228. sw.WriteLine(strd) '插入一整行
  229. sw.Flush()
  230. End Using
  231. End Using
  232. Catch ex As Exception
  233. End Try
  234. My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "GF00-ERP-UPDATE.exe", Str & "\GF00-ERP-UPDATE.exe")
  235. Shell(Str & "\GF00-ERP-UPDATE.exe", vbNormalFocus) : Me.Close()
  236. End If
  237. End Sub
  238. Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 確定_rbt.Click
  239. 系統語言_cb.Text = "繁體中文"
  240. If 系統語言_cb.Text = " " Or 系統語言_cb.Text = "" Then : MGB(對話框(9), 1) : Else
  241. '-----電腦綁定判斷-------------------------------------------------------------------------------------------------------------------------------------------------------------
  242. If 登入綁定_ch.Checked = True Then
  243. PA1 = MACKK : PA2 = diskId : PA3 = diskSerialNumber : PA4 = diskModel
  244. SQL_電腦綁定()
  245. If dr.Read() Then : conn.Close() : 登入第一層() : Else
  246. If 帳號_rtb.Text = "b70340" Or 帳號_rtb.Text = "B70340" Then : conn.Close() : 登入第一層() : Else : conn.Close() : MGB(對話框(6), 1) : Me.Close() : End If
  247. End If
  248. Else : conn.Close() : 登入第一層() : End If
  249. End If
  250. End Sub
  251. Private Sub 登入第一層()
  252. If 帳號_rtb.Text = "b70340" Or 帳號_rtb.Text = "B70340" Then
  253. If Strings.Right(執行檔版本號_lb.Text, 10) <> Strings.Right(資料庫版本號_lb.Text, 10) Then
  254. If 伺服器區域_cb.Text = "測試雲端" Then
  255. 自動更新2()
  256. 登入程序() : 判斷重登 = False
  257. Else
  258. 登入程序() : 判斷重登 = False
  259. End If
  260. Else
  261. 登入程序() : 判斷重登 = False
  262. End If
  263. Else
  264. If Strings.Right(執行檔版本號_lb.Text, 10) <> Strings.Right(資料庫版本號_lb.Text, 10) Then
  265. If 伺服器區域_cb.Text = "測試雲端" Then
  266. 自動更新2()
  267. Else
  268. MGB(對話框(1), 1)
  269. End If
  270. Else
  271. 登入程序() : 判斷重登 = False
  272. End If
  273. End If
  274. End Sub
  275. Private Sub 登入程序()
  276. If 帳號_rtb.Text = "" Then : MGB(對話框(2), 1) : ElseIf 帳號_rtb.Text <> "" Then
  277. If 帳號_rtb.Text = "" Then : MGB(對話框(3), 1) : ElseIf 帳號_rtb.Text <> "" Then
  278. If 驗證_tb.Text = "1" Then
  279. SQL_使用者級別宣告() : If dr.Read() Then : 登入人級別 = dr("級別").ToString : End If
  280. SQL_使用者權限宣告()
  281. If dr.Read() Then
  282. 密碼驗證_tb.Text = dr("密碼").ToString : 密碼日期_tb.Text = dr("密碼日期").ToString
  283. gUserName = dr("姓名").ToString : 登入人部門 = dr("部門").ToString : 登入人課別 = dr("課別").ToString
  284. 登入人組別 = dr("組別").ToString
  285. For I As Integer = 1 To 權限數量 : CC(I) = dr.Item(I + 8 - 1) : Next
  286. FFGG = DateDiff("d", 密碼日期_tb.Text, Format(Today(), "yyyy/MM/dd"))
  287. If CC(45) = True Then : GGHH = 密碼時限 - FFGG
  288. If GGHH <= 0 Then
  289. MGB(對話框(4), 1) : 個人帳號管理.ShowDialog()
  290. Else : 登入第二層() : End If
  291. Else : 登入第二層() : End If
  292. Else : MGB(對話框(15), 1) : End If : dr.Close()
  293. End If
  294. End If
  295. End If
  296. conn.Close()
  297. End Sub
  298. Private Sub 進行下載_lb_Click(sender As Object, e As EventArgs) Handles 進行下載_lb.Click
  299. 自動更新2()
  300. End Sub
  301. Private Sub 隱藏開關_lb_Click(sender As Object, e As EventArgs) Handles 隱藏開關_lb.Click
  302. 輸入密碼.ShowDialog()
  303. If PA = "0003065795" Then
  304. PA = InputBox("請輸入啟動碼!!", "啟用系統", txt)
  305. Dim strDirName As String : Dim filePath As String = Path.Combine(Application.StartupPath, "TEST.txt")
  306. If File.Exists(filePath) Then : File.Delete(filePath) : End If : strDirName = filePath
  307. Try
  308. Using fs As IO.FileStream = New IO.FileStream(strDirName, FileMode.Append)
  309. Using sw As StreamWriter = New StreamWriter(fs, Encoding.Default)
  310. Dim str As String = PA
  311. sw.WriteLine(str) '插入一整行
  312. sw.Flush()
  313. End Using
  314. End Using
  315. Catch ex As Exception : End Try
  316. Application.Restart()
  317. Else : End If
  318. End Sub
  319. Private Sub 登入第二層()
  320. If 密碼_rtb.Text = 密碼驗證_tb.Text Then
  321. If 密碼驗證_tb.Text = "" Then : MGB(對話框(5), 1)
  322. Else
  323. Me.Hide() : Timer1.Enabled = False
  324. ICS_ASMS_ERP_SYS.Show() : 密碼_rtb.Text = "" : 帳號_rtb.Text = ""
  325. End If
  326. ElseIf 密碼_rtb.Text <> 密碼驗證_tb.Text Then : MGB(對話框(5), 1)
  327. End If
  328. End Sub
  329. Private Sub UsernameTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles 帳號_rtb.KeyPress
  330. If e.KeyChar = ChrW(13) Then : Me.確定_rbt.PerformClick() : End If
  331. End Sub
  332. Private Sub PasswordTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles 密碼_rtb.KeyPress
  333. If e.KeyChar = ChrW(13) Then : Me.確定_rbt.PerformClick() : End If
  334. End Sub
  335. Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 取消_rbt.Click
  336. Me.Close()
  337. End Sub
  338. Private Sub 風格()
  339. End Sub
  340. Private Sub UsernameTextBox_TextChanged(sender As Object, e As EventArgs) Handles 帳號_rtb.TextChanged
  341. If IsNumeric(帳號_rtb.Text) = True Then
  342. If 帳號_rtb.Text.Length = 10 Then
  343. SQL_刷卡登入()
  344. If dr.Read() Then
  345. 帳號_rtb.Text = dr("帳號").ToString : 密碼_rtb.Text = dr("密碼").ToString : conn.Close()
  346. Else
  347. 帳號_rtb.Text = "" : 密碼_rtb.Text = "" : conn.Close()
  348. End If
  349. Me.確定_rbt.PerformClick() : Exit Sub
  350. End If
  351. End If
  352. End Sub
  353. Private Sub 語言轉換讀取()
  354. 對話框(0) = "所選擇服務器不是台灣服務器,請連線該服務器所在網域的VPN,確保連線正常後重新選擇伺服器!"
  355. 對話框(1) = "系統版本號 與 資料庫版本號 對應不上,請下載最新的執行檔。"
  356. 對話框(2) = "請輸入帳號! 如使用刷登入,請確定該卡片有合法註冊!"
  357. 對話框(3) = "請輸入帳號!"
  358. 對話框(4) = "密碼過期!"
  359. 對話框(5) = "帳號或密碼錯誤,請重新輸入!"
  360. 對話框(6) = "該電腦沒有註冊,無法使用系統。"
  361. 對話框(7) = "下載完成,請手動刪除就的執行檔,並且用新的執行檔開啟。"
  362. 對話框(8) = "操作不正確,請用手動方式下載更新。"
  363. 對話框(9) = "未選擇語言"
  364. 對話框(10) = "請輸入 小更新 [1]、中更新 [2]、大更新 [3] !!"
  365. 對話框(11) = "網路錯誤,無法連線!!"
  366. 對話框(12) = "正式資料庫無法連線,請通知系統管理員!!"
  367. 對話框(13) = "線路轉換完成!!"
  368. 對話框(14) = "正式,測試資料庫無法使用!!"
  369. 對話框(15) = "帳號錯誤,請重新輸入!!"
  370. End Sub
  371. End Class