我知道要打开局域网中某台机器的某个共享文件夹要用shellexecute(handle,'open','\\Tony\share',nil,nil,sw_normal);
那么如果那台机器是Win2000的话,又设置了权限,例如已经知道了:用户名为:1,密码为:2,我现在想打开它共享的某一文件夹,程序该如何实现,还望指教,谢谢!

解决方案 »

  1.   

    首先用下面的IPCConnect建立连接,然后直接用
    uses
      Windows,winsock,SysUtils,Classes,ComObj, WinInet;FileName := '\\Server\Share\FileName.Text';来进行访问就是了;
    Function IPCConnect(Server , username , Password : String ) : Integer;
    var
      NR : TNetResource;
    begin
      FillChar(NR, SizeOf(NR), 0);
      NR.dwType := RESOURCETYPE_ANY;
      NR.lpLocalName := '';
      NR.lpProvider := '';
      NR.lpRemoteName := pchar(Server);
      Result := WNetAddConnection2(NR, pchar(Password), pchar(UserName), 0);
    end;Function DisIPCConnect(Server : String) : integer;
    begin
      Result := WNetCancelConnection2(pchar(Server),0,True);
    end;
      

  2.   

    http://www.csdn.net/develop/Read_Article.asp?Id=17459
      

  3.   

    kiboisme(还是铁棒.....针)请问你好像没有调用IPCConnect这一Function吧!