![]() |
|
|
Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
Опции темы | Поиск в этой теме | Опции просмотра |
#1
|
||||
|
||||
![]() Как копировать фалы с одного места и заменить с другими файла но в другом месте.....
|
#2
|
||||
|
||||
![]() Windows.CopyFile или Windows.CopyFileEx
|
#3
|
||||
|
||||
![]() Ну поточнее можно ... Люди Исходник
|
#4
|
||||
|
||||
![]() Цитата:
Код:
BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file LPCTSTR lpNewFileName, // pointer to filename to copy to BOOL bFailIfExists // flag for operation if file exists ); Parameters lpExistingFileName Points to a null-terminated string that specifies the name of an existing file. lpNewFileName Points to a null-terminated string that specifies the name of the new file. bFailIfExists Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds. |
#5
|
||||
|
||||
![]() Что то не разобрался вот я хотел использывать вот это
но оно тож не помогает Трабла в том что при вставке оно не заменяет старые а добавляет новые с добавлением в названии файлов слово "Копия" Код:
var OpStruc: TSHFileOpStruct; frombuf, tobuf: array [0..128] of Char; begin FillChar( frombuf, Sizeof(frombuf), 0 ); FillChar( tobuf, Sizeof(tobuf), 0 ); StrPCopy( frombuf, 'C:\my\*.*' ); StrPCopy( tobuf, edit1.Text ); with OpStruc do begin Wnd:= Handle; wFunc:= FO_COPY; pFrom:= @frombuf; pTo:=@tobuf; fFlags:= FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION; fAnyOperationsAborted:= False; hNameMappings:= nil; lpszProgressTitle:= nil; end; ShFileOperation( OpStruc ); end; |
#6
|
||||
|
||||
![]() вот так:
Код:
CopyFile('C:\1.txt','C:\2.txt',true) |
#7
|
||||
|
||||
![]() Не помогает этот способ я уже проверил
туда я не смот пихать edit1.text нохочеть оно брать путь от сюда и если ощибаюсь оно не может копировать фалы с определенной папки если сильно сильно ощибаюсь то как? |
#8
|
||||
|
||||
![]() Блин, ну почитай книжки, в конце уже концов. Или справку, но это конечно, на очень худой конец.
![]() Код:
CopyFile(PChar(Edit1.Text),PChar(Edit2.Text),true) ЗЫЖ Без обид ![]() |
#9
|
|||
|
|||
![]() есть такой код:
Код:
if FileExists(fileToCopy) then begin if CopyFile(pChar(fileToCopy),pChar(copyTo),false) then ShowMessage('ура!') else ShowMessage('Ошибка!'+#13#10 +' Код: '+IntToStr(GetLastError) +#13#10 +'From:'+fileToCopy+#13#10 +'To:'+copyTo); Код:
FileExists(fileToCopy) Последний раз редактировалось ][enk, 22.04.2009 в 14:28. |