Option Strict Off Public Class FTP資料夾管理 ReadOnly ds As New DataSet Private Sub Set_使用者清單() DataGridView1.DataSource = Nothing : ds.Clear() DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing DataGridView1.ColumnHeadersHeight = 25 DataGridView1.AllowUserToAddRows = False SQL_FTP資料夾路徑分配() da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() DataGridView1.Columns(0).Width = 70 : DataGridView1.Columns(1).Width = 200 : DataGridView1.Columns(2).Width = 200 : DataGridView1.Columns(3).Width = 70 End Sub Private Sub FTP資料夾管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.MdiParent = MAOJI_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True Set_使用者清單() Target1 = Target : WebBrowser1.Url = New Uri(Target1) End Sub Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick If e.RowIndex = -1 Then : Else TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView1(1, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView1(2, e.RowIndex).Value.ToString TextBox4.Text = DataGridView1(3, e.RowIndex).Value.ToString End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click SQL_FTP資料夾管理新增() : conn.Close() : Set_使用者清單() End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click SQL_FTP資料夾管理修改() : conn.Close() : Set_使用者清單() End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Dim aa As MsgBoxResult = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel) If aa = MsgBoxResult.Ok Then SQL_FTP資料夾管理刪除() End If : conn.Close() : Set_使用者清單() End Sub End Class