Translation?

G

gsb58

Hi!
This is something I have used in Delphi 6/7. It works fine. My
question: Anybodu that know how to translate to C#.NET (it copies files
over the network), or point me to article?

procedure TfrmCopyCat.btnCopyCatClick(Sender: TObject);
var
OpStruct : TSHFileOpStruct;
FromBuf, ToBuf : Array[0..255] of Char;
mon,s : string;
begin
mon := '\\SERVER\A\MONDAY';
s := 'D:\MONDAY\*.*';

Case rgFrom.ItemIndex of
0:begin
ga1.Progress := 0;
end;
end;

Case rgFrom.ItemIndex of
1:begin
FillChar(OpStruct,SizeOf(OpStruct),0);
FillChar(FromBuf,SizeOf(FromBuf),0);
FillChar(ToBuf,SizeOf(ToBuf),0);
StrPCopy(FromBuf,s);
StrPCopy(ToBuf,mon);
with OpStruct do
begin
Wnd := Application.Handle;
wFunc := FO_COPY;
pFrom := @FromBuf;
pTo := @ToBuf;
fFlags := FOF_NOCONFIRMMKDIR;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil;
end;
ShFileOperation(OpStruct);
end;
end;
end;

Me.Name
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

The code is straighforward, I'm sure if you know (or find) the meaning and
the parameters of those delphi function you can write it in C# pretty
easily, the String class provide all this functionality

cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top