//------------------------------------------------------------------------------
//登录远端计算机
procedure LoginRemoteComputer(AComputerName, AUserName, APassword :String);
const
cCommand = 'net use "//%s" "%s" "/user:%s"';
begin
WinExec(Pchar(Format(cCommand, [AComputerName, APassword, AUserName])), sw_Hide);
Sleep(100);
end;
//------------------------------------------------------------------------------
//注销登录远端计算机
procedure LogOutRemoteComputer(AComputerName :String);
const
cCommand = 'net use "//%s" /delete';
begin
WinExec(Pchar(Format(cCommand, [AComputerName])), sw_Hide);
end;
//------------------------------------------------------------------------------