I have the problem with whitespaces in my console application. My application is crashing because of not allowed chararcters.
My application is expecting an argument which is a path of the filesystem. So it will be called like this
myProg.exe "D:\tmp\with whitespace\" With that information I want to create a file in the given folder, but this is not possible because of not allowed char.
String pdfName = "foobar.pdf String datapath = args[0]; String targetJobFile = datapath + pdfName + ".txt"; I can see in the debugger that the targetJobFile value is
"D:\tmp\with whitespace\"foobar.pdf.txt And there i receive the exception. Thanks
Path.Combine, it will handle issues like this. - Path.Combine on MSDNString pdfName = "foobar.pdfeven compile? your parameter should work fine, as they are enclosed in double quotes