|
-
May 29th, 2010, 02:11 AM
#1
[RESOLVED] Adding date to file name.
This has become a major headache for me. 
I am simply trying to add the days date to a filename.
Code:
FilePathStr = Environment.CurrentDirectory() & "\Data\Data Archive\Padding " & Mydate & ".txt"
'Mydate' is a string made up of datetime.now.day/month/year.
I have also tried inserting , now and today
If I add just one instance of datetime.now.day it works, anymore gives me a DirectoryNotFoundException)
This is really confusing, any help appreciated.
Last edited by dajunka; May 29th, 2010 at 03:42 AM.
Reason: RESOLVED
I use VB.Net 2008 in all my wash, for those whiter whites.
-
May 29th, 2010, 02:17 AM
#2
Re: Adding date to file name.
Most likely it reads your new file name as directory path if you include characters like / or \ in your date string. Try making your date string with - instead.
-
May 29th, 2010, 02:37 AM
#3
Re: Adding date to file name.
Oh my word, I would not have found that in a million years. 
Thanks very much, just changed the little blighter's "/" for "_" and Bobs your uncle. How could something so simple give me more than a days worth of headaches?
I use VB.Net 2008 in all my wash, for those whiter whites.
-
May 29th, 2010, 03:21 AM
#4
Re: Adding date to file name.
Operating System liek Windows XP etc. do not allow / or \ in file names, I tend to use _ with date values in names 
Just remember to mark your thread resolved 
http://www.codeguru.com/forum/showthread.php?t=403073
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|