我想在WIN2000下新建多个用户,如果一个一个的建很费时,所以想能不能有程序来 建立,还有很多的权限问题能不能也在程序里面来完成,有什么方法,

解决方案 »

  1.   

    刚好有资料,给你看看,^_^ 不知道能不能用?
    摘 要:如何自己编程添加NT用户
    关键字:NT 用户
    类 别:系统控制
     
     
    type USER_INFO_1=record 
           usri1_name:pwidechar; 
           usri1_password:pwidechar; 
           usri1_password_age:dword; 
           usri1_priv:dword; 
           usri1_home_dir:pwidechar; 
           usri1_comment:pwidechar; 
           usri1_flags:dword; 
           usri1_script_path:pwidechar; 
         end; 
        buffer=^USER_INFO_1; 
    var 
      Form1: TForm1; implementation {$R *.DFM} 
    function NetUserAdd(Server:PWideChar;Level:DWORD;Buf:pointer;ParmError
    :dword):LongInt; 
       stdcall; external 'netapi32.dll' procedure TForm1.Button1Click(Sender: TObject); 
    var buf:buffer; 
        error:pchar; 
    begin 
    getmem(buf,sizeof(USER_INFO_1)); 
     with buf^ do 
     begin 
      usri1_name:='123e'; 
      usri1_password:='123456789'; 
      usri1_password_age:=0; 
      usri1_priv:=1; 
      usri1_home_dir:=nil; 
      usri1_comment:=nil; 
      usri1_flags:=1; 
      usri1_script_path:=nil; 
     end; 
      netuseradd(nil,1,pointer(buf), 
     // showmessage(inttostr(netuseradd(nil,1,pointer(buf),0))); 
      freemem(buf); 
    end;  
      

  2.   

    来晚了,都被楼上说了。
    补充一点:当想用变量代替  '123e' 时用下面的方法:
    var ws:WideString; 
        ...... 
         ws := Edit1.Text; 
         usri1_name := PWideChar(ws);