procedure TForm1.btn1Click(Sender: TObject);
var
netStore: TNetResource;
begin
netStore.dwType := RESOURCETYPE_ANY;
netStore.lpLocalName := ‘Z:‘;
netStore.lpRemoteName := ‘\\10.1.14.144\人力‘;
netStore.lpProvider := ‘‘;
WNetAddConnection2(netStore, PChar(‘gdpr‘), PChar(‘administrator‘), CONNECT_UPDATE_PROFILE);
if FileExists(‘Z:\EHR-10-12-广州地区公司.xls‘) then
ShowMessage(‘OK‘);
end;
//断开网络连接:
WNetCancelConnection2( ‘Z:‘, CONNECT_UPDATE_PROFILE, True);
http://www.cnblogs.com/jxgxy/archive/2011/09/05/2167570.html
时间: 2024-10-27 02:10:12