关于netuseradd(50分)

  • 主题发起人 主题发起人 xman
  • 开始时间 开始时间
X

xman

Unregistered / Unconfirmed
GUEST, unregistred user!
NET_API_STATUS NetUserAdd(<br>&nbsp; &nbsp; LPWSTR servername, <br>&nbsp; &nbsp; DWORD level, <br>&nbsp; &nbsp; LPBYTE buf, <br>&nbsp; &nbsp; LPDWORD parm_err <br>&nbsp; &nbsp;); <br>。。。。。。。。<br>Return Values<br>If the function returns account information, the return value is NERR_Success.<br>。。。。。。<br>&nbsp;<br>小弟在编程时要处理返回值,但在msdn,win32.hlp,windows.pas<br>和lmaccess.h中都找不到NET_API_STATUS类型的定义,谁能帮帮俺?
 
function NetUserAdd<br>(Server:PWideChar;Level:DWORD;Buffer:PChar;ParmError:PChar):LongInt; <br>stdcall; external 'netapi32.dll'<br><br>因此 NET_API_STATUS = LongInt
 
可我怎样才能得到返回值的含义呢?<br>已知的值如下:<br>NERR_Success:success<br>ERROR_ACCESS_DENIED The user does not have access to the requested information.<br>NERR_InvalidComputer Thiecomputer name is invalid.<br>NERR_NotPrimary The operation is allowed only on the primary domain controller of the domain.<br>NERR_GroupExists The group already exists.<br>NERR_UserExists The user account already exists.<br>NERR_PasswordTooShort The password is shorter than required.<br><br>我想一定在那里有这些常量的定义
 
delphi少很多东西,装个vc或者c++ builder吧,他们的 include 下的头文件<br>里面有全部东西
 
装了vc,就是不知道在哪个文件里,<br>不会要一个个看吧?555555
 
取下在一个NetTools吧 里面都有了, NetTools好像很多Delphi网站上都有,比如32位深度历险
 
找了好久终于在vc的头文件中找到了,拿出来与大家共享:<br>NERR_Success &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =0;<br>ERROR_ACCESS_DENIED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=5;<br>NERR_Base &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=2100;<br>NERR_InvalidComputer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =NERR_Base+251;<br>NERR_NotPrimary &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=NERR_Base+126;<br>NERR_GroupExists &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =NERR_Base+123;<br>NERR_UserExists &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=NERR_Base+124;<br>NERR_PasswordTooShort &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=NERR_Base+145;<br><br>不过又出现几个新问题,<br>1)如果根据 LPDWORD parm_err 判断返回值,则总是零,<br>但我用域用户管理器去查却没有加进来;<br><br>如果根据 result:=neradduser(...),判断result的返回值,则<br>不是以上列出的返回值的任一个,到底该用那一个判断返回值? <br><br>2)是否应该改用 ntaddglobaluser.另外,nttools控件组也有这样的问题,<br>即不报错,也没有添加成功,不知有没有人编程实现过?<br>请继续关注,thanx<br>
 
你这里列出的常量很少啊!能保证概括了所有返回值吗?<br>你的result到底返回什么值呢?贴上来看看。
 
多人接受答案了。
 
&nbsp;如果“问题:关于netuseradd ( 积分:50, 回复:9, 阅读:78 )”已解决,请发给我一份,<br>我给你们加分!! 谢谢。<br>
 

Similar threads

I
回复
0
查看
524
import
I
I
回复
0
查看
627
import
I
I
回复
0
查看
646
import
I
I
回复
0
查看
760
import
I
后退
顶部