Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

FTP資料夾管理.vb 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Option Strict Off
  2. Public Class FTP資料夾管理
  3. ReadOnly ds As New DataSet
  4. Private Sub Set_使用者清單()
  5. DataGridView1.DataSource = Nothing : ds.Clear()
  6. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  7. DataGridView1.ColumnHeadersHeight = 25
  8. DataGridView1.AllowUserToAddRows = False
  9. ConnOpen()
  10. SQL1 = "SELECT 資料夾名稱, 指定頁面, 備註, 指定 FROM FTP資料夾管理"
  11. CmdSet_For_DGV() : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
  12. End Sub
  13. Private Sub Set_grid()
  14. DataGridView1.Columns(0).Width = 70 : DataGridView1.Columns(1).Width = 200 : DataGridView1.Columns(2).Width = 200 : DataGridView1.Columns(3).Width = 70
  15. End Sub
  16. Private Sub FTP資料夾管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  17. Me.MdiParent = GCM_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  18. Set_使用者清單()
  19. Target1 = Target
  20. WebBrowser1.Url = New Uri(Target1)
  21. End Sub
  22. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  23. timeNow = 0
  24. GCM_ERP_SYS.Timer1.Enabled = False
  25. GCM_ERP_SYS.Timer1.Enabled = True
  26. End Sub
  27. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  28. timeNow = 0
  29. GCM_ERP_SYS.Timer1.Enabled = False
  30. GCM_ERP_SYS.Timer1.Enabled = True
  31. End Sub
  32. Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
  33. If e.RowIndex = -1 Then : Else
  34. TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView1(1, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView1(2, e.RowIndex).Value.ToString
  35. TextBox4.Text = DataGridView1(3, e.RowIndex).Value.ToString
  36. End If
  37. End Sub
  38. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  39. ConnOpen()
  40. SQL1 = "INSERT INTO FTP資料夾管理 (資料夾名稱, 指定頁面, 備註, 指定) " &
  41. "VALUES (N'" & TextBox1.Text & "',N'" & TextBox2.Text & "',N'" & TextBox3.Text & "',N'" & TextBox4.Text & "')"
  42. CmdSet_For_dr()
  43. conn.Close()
  44. Set_使用者清單()
  45. End Sub
  46. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  47. ConnOpen()
  48. SQL1 = "UPDATE FTP資料夾管理 SET 指定頁面 = N'" & TextBox2.Text & "', 備註 = N'" & TextBox3.Text & "', 指定 = N'" & TextBox4.Text & "' WHERE (資料夾名稱 = N'" & TextBox1.Text & "')"
  49. CmdSet_For_dr()
  50. conn.Close()
  51. Set_使用者清單()
  52. End Sub
  53. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  54. SQL1 = "DELETE FROM FTP資料夾管理 WHERE (資料夾名稱 = N'" & TextBox1.Text & "')"
  55. cmd.CommandText = SQL1 : cmd.Connection = conn
  56. ConnOpen()
  57. Dim aa As MsgBoxResult
  58. aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
  59. If aa = MsgBoxResult.Ok Then : cmd.ExecuteNonQuery() : End If
  60. conn.Close()
  61. Set_使用者清單()
  62. End Sub
  63. End Class