.netexceptionargumentexceptionillegal-characterspath-combine

System.ArgumentException illegal characters in path


I am using Path.Combine, and one of the strings contain a Unicode characters. I get {System.ArgumentException} exception; illegal characters in path.

According to MSDN filepath/name can have unicode characters. Why do I get this exception?

Edit:

Here is the code:

Path.Combine("C:\PDM\Silver","Amabel Bender QQQ")

Solution

  • I figured out the problem. The second string contains a "tab" character in it causing the exception. (that didn't showed up when I pasted the string here)

    Thanks everyone and sorry for the confusion.