L
ling0303
Unregistered / Unconfirmed
GUEST, unregistred user!
我的目的是,用已知的用户名和密码先去登陆另一台机器,再用COPYFile复制文件,不胜感激!!!!!!!!!!
procedure TForm1.Button1Click(Sender: TObject);
var
NetR:NETRESOURCE;
intRet:Longint;
begin
NetR.dwScope:=RESOURCE_GLOBALNET;
NetR.dwType:=RESOURCETYPE_DISK;
NetR.dwDisplayType:=RESOURCEDISPLAYTYPE_SHARE;
NetR.dwUsage:=RESOURCEUSAGE_CONNECTABLE;
netr.lpProvider:='';
NetR.lpLocalName:=pchar('G:/');
NetR.lpRemoteName:=pchar('//hp-netserver/C:/FF');
intRet:=WNetAddConnection2(NetR,pchar(''),pchar('administrator'),CONNECT_UPDATE_PROFILE);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
NetR:NETRESOURCE;
intRet:Longint;
begin
NetR.dwScope:=RESOURCE_GLOBALNET;
NetR.dwType:=RESOURCETYPE_DISK;
NetR.dwDisplayType:=RESOURCEDISPLAYTYPE_SHARE;
NetR.dwUsage:=RESOURCEUSAGE_CONNECTABLE;
netr.lpProvider:='';
NetR.lpLocalName:=pchar('G:/');
NetR.lpRemoteName:=pchar('//hp-netserver/C:/FF');
intRet:=WNetAddConnection2(NetR,pchar(''),pchar('administrator'),CONNECT_UPDATE_PROFILE);
end;