Sep 9, 2008 #1 dandot Programmer Joined Jul 19, 2005 Messages 53 Location CA How would I create a string for a dynamic file path for something like this "\\2008\2008-09\2008-09-08\DEFAULT.txt" I planned on using DateTime.Now function to get the year and month etc but the \ are giving me headaches with the string
How would I create a string for a dynamic file path for something like this "\\2008\2008-09\2008-09-08\DEFAULT.txt" I planned on using DateTime.Now function to get the year and month etc but the \ are giving me headaches with the string
Sep 9, 2008 1 #2 jmeckley Programmer Joined Jul 15, 2002 Messages 5,269 Location US Code: DateTime date = DateTime.Today; string.Format(@"\\{0:YYYY}\{0:YYYY-MM}\{0:YYYY-MM-dd}\DEFAULT.txt", date); or Code: DateTime date = DateTime.Today; string.Format("\\\\{0:YYYY}\\{0:YYYY-MM}\\{0:YYYY-MM-dd}\\DEFAULT.txt", date); Jason Meckley Programmer Specialty Bakers, Inc. Upvote 0 Downvote
Code: DateTime date = DateTime.Today; string.Format(@"\\{0:YYYY}\{0:YYYY-MM}\{0:YYYY-MM-dd}\DEFAULT.txt", date); or Code: DateTime date = DateTime.Today; string.Format("\\\\{0:YYYY}\\{0:YYYY-MM}\\{0:YYYY-MM-dd}\\DEFAULT.txt", date); Jason Meckley Programmer Specialty Bakers, Inc.
Sep 9, 2008 Thread starter #3 dandot Programmer Joined Jul 19, 2005 Messages 53 Location CA tanks for the help jason Upvote 0 Downvote