471,610 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Translation?

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

Nov 29 '05 #1
1 1966
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<gs***@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
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

Nov 29 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Matt | last post: by
40 posts views Thread by Chiwa | last post: by
5 posts views Thread by Haines Brown | last post: by
7 posts views Thread by Peter Eisentraut | last post: by
4 posts views Thread by Chris Croughton | last post: by
2 posts views Thread by James | last post: by
4 posts views Thread by Tomás Ó hÉilidhe | last post: by
reply views Thread by Stef Mientki | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.