正在阅读:在WIN2000与98中创建共享文件夹在WIN2000与98中创建共享文件夹

2004-03-18 14:45 出处:PConline 作者:happy_david 责任编辑:linjixiong

  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;




察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品