473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Change the date modified

I see where I can change the date a file is created....

File.SetCreationTime(path)

But how can I change the date a file is modified.

Thanks, C

Jan 20 '06 #1
3 10612
Hi

File.SetLastWriteTime(path,date)

Hth,

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

"Cornjerker" <ad****@gmail.com> schreef in bericht
news:11*********************@z14g2000cwz.googlegro ups.com...
I see where I can change the date a file is created....

File.SetCreationTime(path)

But how can I change the date a file is modified.

Thanks, C

Jan 20 '06 #2
Thanks for the reply, but this didn't change the "Date Modified" in the
windows explorer. I'll just use the date created instead.

C

Jan 21 '06 #3
Did you try it like this?

System.IO.File.SetLastWriteTime("c:\test.txt", New Date(2099, 5, 5))

because this should do the trick.

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)
"Cornjerker" <ad****@gmail.com> schreef in bericht
news:11**********************@g14g2000cwa.googlegr oups.com...
Thanks for the reply, but this didn't change the "Date Modified" in the
windows explorer. I'll just use the date created instead.

C

Jan 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9332
by: Eclectic | last post by:
I have a script that reads all directory names within a specific location (only containing folders), then lists all jpeg files in those directories. Here is my script: function...
3
1694
by: Lee Holsenbeck | last post by:
i have been using the getfiles method, but that retrieves only alphabetically. i'd like to be able to retrieve filenames in a directory by thier date modified. does .net have a method for this ?...
2
1759
by: Gerry Abbott | last post by:
Hi all, Is there a convenient way to trap the date/time of the last change to the data (in the tables) in a database. (the date modified changes when the file is accessed, irrespective of...
1
2811
by: Sebastian Santacroce | last post by:
Hi, How do I get the Date Modified from a file that was selected with the OpenFileDialog? Thanks,
2
1563
by: wsnyder3 | last post by:
I have many forms but all the information is related to one another. I wanted to know if there was a way that if someone updates a account that it will show the last date modified on all the...
3
4567
by: Bface | last post by:
Hi all, Hope everyone had a good holiday. I am having a difficult time changing the date format of a field from Excel. I have never had this problem before. I link the excel spreadsheet to my DB,...
1
1125
by: pjnambiar | last post by:
Hello friends can any one help me out by providing code to read the date modified of a file. this is required because I have developed a enquiry utility where in i have to update the database...
2
2548
by: ragazzo | last post by:
I am using this code to load files But i have problem when there is a large number of files, ( it shows nothing ) is it posible to list only files where date modified is today`s date. And show in...
0
1382
by: carmeno | last post by:
Hi can someone please help me. i have an assignment due and i need to use DOS on windows xp and-take a screen capture of ( i can do a screen capture its the following that is the problem) directory...
0
7037
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
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.