473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2016
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt | last post by:
Short Description: The Translation Hub is not picking up the TNS names file. I'm using Oracle 9ids. It doesn't work for any users and it has never worked since it's been installed. Long...
40
by: Chiwa | last post by:
Hey, Expression: Math.floor(x * 100) / 100 x= 4.1 gives 4.09, why in gods name? While other values for x don't give a problem. Thx in advance
5
by: Haines Brown | last post by:
I suspect this is a FAQ, but as a guide to my further investigation, I wondered what the options are for providing readers of my web pages with the ability to translate the pages into their own...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
7
by: Peter Eisentraut | last post by:
Greetings. The official PostgreSQL documentation has been translated to German and has been published as a book by verlag moderne industrie/mitp ("PostgreSQL: Das offizielle Handbuch", ISBN...
4
by: Chris Croughton | last post by:
Does a translation unit have to have at least one externally visible declaration or function definition to be valid? As I read the standard, it doesn't: it must have at least one declaration or...
2
by: James | last post by:
In oracle I can do the following: select CONVERT(COLUMNOFNAMES,'US7ASCII') from mytable -- It will take a name like Albrecht Dürer and change it into Albrecht Durer and is useful in where...
1
by: dilabox | last post by:
Hello, I have overloaded the global new, delete, new and delete operators inside a "static library". The library uses private memory allocation routines that must not be accessible from other...
4
by: Tomás Ó hÉilidhe | last post by:
I have a translation unit which defines a global object: BEGIN "yellow.c" int i = 7; END I want this object to be accessible from other translation units, so I give it external linkage....
0
by: Stef Mientki | last post by:
hello, I've build a translation tool, to translate all strings in a python source file. As a extra gadget I added translation through Babel Fish, using beautifulsoup. Although it works...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.