帮助的示例文件,更改用户窗口,admin 这个用户在 管理组,不允许改其他组
确定 按钮的代码
Dim UserName As String = e.Form.Controls("UserName").Value
Dim UserGroup As String = e.Form.Controls("UserGroup").Value
Dim PassWord As String = e.Form.Controls("PassWord").Value
Dim OldUserName As String
Dim Parts() As String = e.Form.Text.Split("-"c)
OldUserName = Parts(Parts.Length -1)
If UserName = "" OrElse UserGroup = "" Then
Messagebox.show("请输入用户名和用户分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
Dim dr As DataRow = _UserTable.SQLFind("[Name]= '" & OldUserName & "'")
If dr IsNot Nothing Then
dr("Name") = UserName
dr("Group") = UserGroup
dr("Password") = PassWord
dr.Save()
If Forms("用户管理").Opened Then
With Forms("用户管理").Controls("ListBox1")
.Items(.SelectedIndex) = UserName
End With
End If
e.Form.Close
Else
Messagebox.show("更改用户失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
请问应该怎么改

此主题相关图片如下:.png