您的位置:逆风者 VB 正文
原作者:www.upwinder.com 添加时间:2007-09-02 原文发表:2007-08-31 人气:34 来源:未知

本文章共4734字,分4页,当前第1页,快速翻页:
 

声明部分

Option Explicit
Const NERR_Success = 0
Const ERROR_MORE_DATA = 234&
Const MAX_PREFERRED_LENGTH = -1&
Const LG_INCLUDE_INDIRECT = &H1
Const User_Priv_User = &H1
逆@风@者
Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
Const NERR_BASE = 2100
Const MAX_NERR = NERR_BASE 899
Const LOAD_LIBRARY_AS_DATAFILE = &H2
Const FORMAT_MESSAGE_FROM_HMODULE = &H800
Type TUser1 ' Level 1
ptrName As Long
ptrPassword As Long
dwPasswordAge As Long
dwPriv As Long
ptrHomeDir As Long
ptrComment As Long
dwFlags As Long
ptrScriptPath As Long
End Type
Type USER_INFO_0
usri0_name As Long
End Type
Type LOCALGROUP_INFO_0
lgrpi0_name As Long
End Type
Type LOCALGROUP_USER_INFO_0
lgrui0_name As Long
End Type
Type UserInfo_1
Username As String
Password As String
PasswordAge As Long
Privilege As Long
HomeDir As String
Comment As Long
Flags As Long
ScriptPath As String
End Type
Type LOCALGROUP_MEMBERS_INFO_3
lgrmi3_domainandname As Long
End Type
Type USER_INFO_1003
usri1003_password As Long
End Type

Private Usr1 As UserInfo_1

'用户所在组
Declare Function NetUserGetLocalGroups Lib "netapi32.dll" (ByVal ServerName As String, ByVal Username As String, ByVal Level As Long, ByVal flag As Long, bufptr As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long) As Long
'本地组
Declare Function NetLocalGroupEnum Lib "netapi32.dll" (ByVal ServerName As String, ByVal Level As Long, bufptr As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resumehandle As Long) As Long
Declare Function lstrlen Lib "Kernel32.dll" Alias "lstrlenW" (ByVal lpszString As Long) As Long
Declare Function lstrcpy Lib "Kernel32.dll" Alias "lstrcpyW" (lpszString1 As Any, lpszString2 As Any) As Long
Declare Function NetApiBufferFree Lib "netapi32.dll" (ByVal Buffer As Long) As Long
Declare Sub RtlMoveMemory Lib "Kernel32.dll" (Destination As Any, Source As Any, ByVal Length As Long)
'添加用户
Private Declare Function NetUserAdd Lib "Netapi32" (ByVal ServerName As String, ByVal Level As Long, Buffer As Any, ParamErr As Long) As Long
'用户列表
Declare Function NetUserEnum Lib "netapi32.dll" (ByVal ServerName As String, ByVal Level As Long, ByVal filter As Long, bufptr As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
'添加到本地组
Declare Function NetLocalGroupAddMembers Lib "netapi32.dll" (ByVal ServerName As String, ByVal GroupName As String, ByVal Level As Long, buf As Any, ByVal totalentries As Long) As Long
'删除用户
Declare Function NetUserDel Lib "netapi32.dll" (ServerName As Byte, Username As Byte) As Long
'从组中删除用户
Declare Function NetGroupDelUser Lib "netapi32.dll" (ServerName As Byte, GroupName As Byte, Username As Byte) As Long
'修改密码
Declare Function NetUserChangePassword Lib "netapi32.dll" (ByVal domainname As String, ByVal Username As String, ByVal OldPassword As String, ByVal NewPassword As String) As Long
Private Declare Function NetGetDCName Lib "netapi32.dll" (ServerName As Long, domainname As Byte, bufptr As Long) As Long
Private Declare Function LoadLibraryEx Lib "kernel32" Alias "LoadLibraryExA" (ByVal lpLibFileName As String, ByVal hFile As Long, ByVal dwFlags As Long) As Long
 

本文章更多内容1 - 2 - 3 - 4 - 下一页>>
相关文章

用VB设计更换屏幕保护的程序
用VB编写“红绿灯”程序
用VB设计聚焦框程序
VB与Windows API 间的呼叫技巧
用Winsock制作一套聊天室和对话系统
无框窗体移动最简法(程序)
VB创建位图菜单
VB 从零开始编外挂(七)
用VB打造自己的SQL连接器
在程序中打开 Internet 拨号连接窗口
用Visual Basic自编小游戏
几行VB代码拿下注册表
用VB设计一个定时闹钟程序
如何开发一个属于自己的编程语言开发工具
用VB设计MSN信息群发软件
编写快速高效的VB程序
无闪烁地快速附加字符串到TextBox控件
善用 Assume No Aliasing 编译选项
VB中OLE调用的优化方法
妙用Replace函数替代字符串连接操作符

相关评论


本文章所属分类:首页 VB

  热门关键字: