this...
...doesn't get rid of the "\" in the date string such as "02\12\03"Code:DateTime.Now.ToShortDateString().Replace("\\", "-")
it should be giving me "02-12-03".
Whereas, this DOES work...
which gives me "10.15" rather than "10:15".Code:DateTime.Now.ToShortTimeString().Replace(":", ".")
What the hell is going on?
this is my full code...
Code:string pathTemp = itsLocalLogPath + category + "_" + DateTime.Now.ToShortDateString().Replace("\\", "-") + "_" + DateTime.Now.ToShortTimeString().Replace(":", ".") + EXTN_LOG_FILE; //write the error message to a local file on the HDD MySW = new StreamWriter(pathTemp, false);




Reply With Quote