July 24, 2014, 02:25:00 AM
News: If someone gives you crap then give them a Bad Star
Pages: [1]   Go Down
Author Topic: Lost Topic Title (vb.net SetCreationTime)  (Read 637 times)
Jethro
Founders
*

Stars: +0/-0
Offline Offline

Posts: 1845



WWW
« on: June 22, 2006, 09:55:57 PM »

Have tried a couple of methods neither of which appear to be working  

Anyone got a solution, besides knitting a new date and time and posting it the files on server ?
« Last Edit: June 26, 2006, 08:39:55 PM by Jethro » Logged

[size=] - Movie Reviews, Discussion, and in due course articles and stuff and that [/size]

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 10912


Don't look back. Look in the mirror to look back.


WWW
« Reply #1 on: June 22, 2006, 10:35:58 PM »

OK this a VB 6 solution but atleast it should point you at some direction while I look for .NET example.

Logged

Jethro
Founders
*

Stars: +0/-0
Offline Offline

Posts: 1845



WWW
« Reply #2 on: June 23, 2006, 12:37:11 AM »

Probably not a good idea to use that could in a .net projection their Mr Wrack, they are slapping me everytime l try for an API call rather than getting a framework resolution.

Will post up what l tried once l go upstairs to add the next nifty change to the project source .... woohoo XML processing  
Logged

[size=] - Movie Reviews, Discussion, and in due course articles and stuff and that [/size]

Jethro
Founders
*

Stars: +0/-0
Offline Offline

Posts: 1845



WWW
« Reply #3 on: June 23, 2006, 01:42:21 AM »

Code:
File.SetLastWriteTime(newfile, System.DateTime.Now)
'File.SetCreationTime(newfile, System.DateTime.Now)

Neither method appears to be working.
Logged

[size=] - Movie Reviews, Discussion, and in due course articles and stuff and that [/size]

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 10912


Don't look back. Look in the mirror to look back.


WWW
« Reply #4 on: June 23, 2006, 04:43:42 AM »

I know using API is not a good idea. I just posted that so you have atleast a start.

Those methods are not working because the LastWriteTime and CreationTime is a readonly property.
Logged

Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« Reply #5 on: June 23, 2006, 05:23:35 AM »

Jeff, this works fine for me: (VS 2005)

Code:
Dim filename As String = "c:\test.html"
Dim filetime As DateTime = DateTime.Now()
File.SetCreationTime(filename, filetime)
Logged


Jethro
Founders
*

Stars: +0/-0
Offline Offline

Posts: 1845



WWW
« Reply #6 on: June 26, 2006, 08:39:17 PM »

Quote from: Slowhand
Jeff, this works fine for me: (VS 2005)

Code:
Dim filename As String = "c:\test.html"
Dim filetime As DateTime = DateTime.Now()
File.SetCreationTime(filename, filetime)

Wasn't working on my test rig, but change the last line to

File.SetLastWriteTime(fName, fTime)

And it's spot on  

Thanks for the help.... wouldn't have got there without the GT geek mafia  
Logged

[size=] - Movie Reviews, Discussion, and in due course articles and stuff and that [/size]

Pages: [1]   Go Up
Print
 
Jump to: