Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.02.24;
Скачать: CL | DM;

Вниз

Файлы   Найти похожие ветки 

 
K7   (2003-02-11 20:44) [0]

Есть файл ....
надо изменить дату и время его создания
как это зделать.


 
К7   (2003-02-11 21:25) [1]

Может кто нибудь поделится своими мыслями и знаниями ???????


 
Романов Р.В. ©   (2003-02-11 21:39) [2]

SetFileTime


 
Андрей Сенченко ©   (2003-02-11 21:53) [3]

Вообще то в таких случаях Help охотно делится и тем и другим.

Алгоритм такой :
1. Жмем F1, Выбираем "разделы".
2. Набираем слово files
3. Обнаруживаем files, date-time routines, заходим поглядеть
видим :
The FileAge, FileGetDate, and FileSetDate routines operate on operating system date-time values. FileAge returns the date-and-time stamp of a file, or -1 if the file does not exist. FileSetDate sets the date-and-time stamp for a specified file, and returns zero on success or an error code on failure. FileGetDate returns a date-and-time stamp for the specified file or -1 if the handle is invalid.
As with most of the file manipulating routines, FileAge uses a string filename. FileGetDate and FileSetDate, however, take a Handle type as a parameter. To get access to a Windows file Handle either

Call the Windows API CreateFile function. CreateFile is a 32-bit only function that creates or opens a file and returns a Handle that can be used to access the file.
Instantiate TFileStream to create or open a file. Then use the Handle property as you would a Windows’ file Handle. See Using file streams for more information.


4. Вешаем на кнопочку например FileSetDate, ставим скобку и смотрим : что нас просят ввести ... АГА .. имя файла и новые дату-время
5. Собственно все. Как текущие дату-время в "естественном формате" перевести в TDateTime надеюсь найдете



 
К7   (2003-02-13 00:31) [4]

SetFileTime
Выдает ошибку мол тип должен
быть PFileTime объясните по-
жалуйста с ней работать.
Или реальный пример.
Я ведь только начинаю познавать
мир програмирования и делфи поэ-
тому прошу ответить намой вопрос,
разобратся самому не получается.


 
Palladin ©   (2003-02-13 01:23) [5]

FileSetDate(<имя файла>,DateTimeToFileDate(EncodeDate(<год>,<месяц>,<день>)));



Страницы: 1 вся ветка

Текущий архив: 2003.02.24;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.012 c
1-75926
LT
2003-02-14 16:14
2003.02.24
Caption


1-75920
SergeN
2003-02-14 12:48
2003.02.24
case of


3-75832
Arkady
2003-02-06 16:46
2003.02.24
TADOTable


1-75931
Ricky-Ticky-Tavy
2003-02-14 09:02
2003.02.24
OLE, Word2000, Delphi5, WinME не получается


3-75767
sav00
2003-02-03 11:57
2003.02.24
Печать DBGrid