![](/img/trans.png)
[英]Error System.NotSupportedException : The given path's format is not supported
[英]What is causing NotSupportedException (“The given path's format is not supported”) while using a valid path?
我正在编写一个简单的控制台应用程序,它将从测试文件中读取 xml 并将其反序列化为一个对象。
var s = File.ReadAllBytes("G:\\Temp\\Publishing\\2.txt");
Stream _response = File.OpenRead("G:\\Temp\\Publishing\\2.txt");
var s = File.ReadAllBytes(@"g:\temp\publishing\2.txt");
var s = File.ReadAllBytes(@"G:\Temp\Publishing\2.txt");
我已经尝试了以上所有方法来读取文件,但它总是抛出NotSupportedException
并显示一条消息
不支持给定路径的格式。
上述路径中的格式错误是什么?
根据参考来源: http : //referencesource.microsoft.com/#mscorlib/system/io/filestream.cs#732
如果路径中:
的索引位于第三个位置或更高位置,则将抛出NotSupportedException
。 (人们会期望:
成为第二个字符)您确定源中没有零宽度组合字符或其他类似的 Unicode 恶作剧吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.