I am trying to save a number of images and I'd like to use the DateTime to have distinct and identifiable Filenames. So I create a String with the correct Path, add the datetime to it and remove the spaces, dots and colons.
String imagePath = "D:\\Patienten\\" + username;
imagePath += "\\"+DateTime.Now.ToString();
Console.WriteLine("WithFilename: " + imagePath);
imagePath.Replace(" ", "");
Console.WriteLine("Without \" \" : " + imagePath);
imagePath.Replace(".", "");
Console.WriteLine("Without \".\": " + imagePath);
imagePath.Replace(":", "");
Console.WriteLine("Output format: " + imagePath);
imagePath += ".png";
image.Save(imagePath);
According to the console output the String doesnt change at all. Meaning all the Output Strings from Console.Writeline are identical. I am using c# in visual Studio Express 2010 in case that makes a difference. Can anyone find an Error here?
Thanks in advance!