Autor Beitrag
Bronstein
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Do 05.02.04 17:52 
Wie kann ich eine Datei, die unter c:\aa.txt liegt ausschneiden und in c:\Programme\Adressen\ einfügen. Vielleicht hat jemand eine Lösung für dieses Problem wäre sehr dankbar.
mfg
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Do 05.02.04 17:55 
Versuchs mal mit "MoveFile":

ausblenden Delphi-Quelltext
1:
MoveFile('C:\aa.txt', 'C:\Programme\Adressen\aa.txt');					
Bronstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Do 05.02.04 18:14 
Das funktioniert aber wie kann ich die Datei nur kopieren, dass sie in beiden Verzeichnissen vorhanden ist. Sorry habe mich falsch ausgedrückt.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Do 05.02.04 19:28 
verbessern und ändern wir den code mal ein bisschen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var CopyFrom,CopyTo:string;
begin
CopyFrom:='C:\aa.txt';
CopyTo:='C:\Programme\Adressen\aa.txt';
if fileexists(CopyFrom) then //wenn quelldatei existiert
CopyFile(pchar(CopyFrom), pchar(CopyTo),true);
//wenn der letzte parameter true ist, wird die datei nur kopiert, wenn sie noch  nicht vorhanden ist

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Bronstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 578
Erhaltene Danke: 1

WIN XP
Delphi 6 / Delphi 2006 / Delphi XE
BeitragVerfasst: Do 05.02.04 20:06 
Das funktioniert danke
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Fr 06.02.04 13:21 
hätte mich auch gewundert wenn nicht :mrgreen:, gern geschehen

_________________
Patrick
im zweifelsfall immer das richtige tun!!!