Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function CopyFileAcrossNetwork(source, dest : string): boolan;
Result:=MoveFileEx(PChar(source),PChar(dest),MOVEFILE_COPY_ALLOWED or MOVEFILE_WRITE_THROUGH);
procedure TForm1.Button1Click(Sender: TObject);
begin
if copyfileacrossnetwork('c:\T1.TXT','\\development5\c\T1.TXT')then
showmessage('OK')
else
showmessage('ooerrr');
end;
function TForm1.CopyFileAcrossNetwork(source, dest : string): boolean;
begin
Result := CopyFile(PChar(source), pchar(dest), FALSE);
end;
WNetGetUniversalName(pchar(Local), REMOTE_NAME_INFO_LEVEL, pchar(NameStruct), MaxNetPathLen)
function GetUNCName(const LocalPath: string): string;
var
BufferSize: DWord;
DummyBuffer: Byte;
Buffer: Pointer;
Error: DWord;
begin
BufferSize := 1;
WNetGetUniversalName(PChar(LocalPath), UNIVERSAL_NAME_INFO_LEVEL, @DummyBuffer, BufferSize);
Buffer := AllocMem(BufferSize);
try
Error := WNetGetUniversalName(PChar(LocalPath), UNIVERSAL_NAME_INFO_LEVEL, Buffer, BufferSize);
if Error <> NO_ERROR then
begin
SetLastError(Error);
RaiseLastWin32Error;
end;
Result := PUniversalNameInfo(Buffer)^.lpUniversalName
finally
FreeMem(Buffer);
end;
end;
...
str := GetUNCName('y:\abc\')