XmlDocument.Save() throws expection when file name is containing colon ":".
-
Hi... I am getting NotSupportedException "The given path's format is not supported." XmlDocumentObject.Save(filename); filename is "L:PROT", because it contains colon that's why exception is coming. Is there any alternative to use : in filename which could be saved in XmlDocument? Thanks in Advance.. Piyush
-
Hi... I am getting NotSupportedException "The given path's format is not supported." XmlDocumentObject.Save(filename); filename is "L:PROT", because it contains colon that's why exception is coming. Is there any alternative to use : in filename which could be saved in XmlDocument? Thanks in Advance.. Piyush
There are certain characters and filenames (such as CON or PRN) that you can't use when writing out a file. The : is used as a part of path identification, so is unavailable. You need to remove this colon.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Hi... I am getting NotSupportedException "The given path's format is not supported." XmlDocumentObject.Save(filename); filename is "L:PROT", because it contains colon that's why exception is coming. Is there any alternative to use : in filename which could be saved in XmlDocument? Thanks in Advance.. Piyush
hi,
System.IO.Path.InvalidPathChars
will return a char array contianing the platform specfic characters that cannot be specified in path string. -> compare your characters against the invalid chars to determinate that your path is valid or not.. greetz :)