strpcopy(_ServerName,ServerName); try Result := NTNetShareDel(_ServerName, NetName,0); finally FreeMem(_ServerName,255); end; finally FreeLibrary(Libhandle); end; end; function AddShareResource (ServerName : PChar; FilePath : PChar; NetName : PChar; Remark : PChar ) : Integer; var MyShare : Share_Info50; PMyShare : ^Share_Info50; LibHandle : THandle; begin LibHandle := LoadLibrary(NTlib); if LibHandle = 0 then raise Exception.Create('Unable to map library: ' + MElib); try @MENetShareAdd := GetProcAddress(Libhandle, 'NetShareDel'); strLcopy(MyShare.shi50_netname,NetName,13); MyShare.shi50_type := 0; MyShare.shi50_flags := 0; MyShare.shi50_remark := Remark; MyShare.shi50_path := FilePath; {MyShare.shi50_rw_password := nil ; MyShare.shi50_ro_password :=nil ;} PMyShare := @MyShare; Result := MENetShareAdd(ServerName,50,PMyShare,SizeOf(MyShare)); finally FreeLibrary(Libhandle); end; end; |
正在阅读:在WIN2000与98中创建共享文件夹在WIN2000与98中创建共享文件夹
2004-03-18 14:45
出处:PConline
责任编辑:linjixiong
键盘也能翻页,试试“← →”键