Dim dt As DataTable = DataTables("Authorize")
Dim dr As DataRow
'然后判断权限的授权用户是否包括此用户或此用户所属的分组
If Args(1) = "" Then
dr = dt.Find("Group = '" & args(0) & "' And Permission Is Null" )
Else
dr = dt.Find("Group = '" & args(0) & "' And Permission = '" & args(1) & "'")
End If
If dr Is Nothing Then
MessageBox.show("不存在名為『" & args(1) & "』權限!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return False
End If
If dr.IsNull("Loginname") = False Then
Dim nms() As String = dr("Loginname").Split(",")
For Each nm As String In nms
If nm = _LoginName Then '如果授权用户包括登录用户所属的分组或其用户名
Return True '返回True
End If
Next
End If
Return False