我收到“NotSupportedExeption 未被用户代码处理 - 不支持指定的路径格式”错误,即使我按照要求使用字符串。
string path = folder + "/" + filename;
fileByte = File.ReadAllBytes(path); // error here
知道问题是什么吗?
将代码编辑为此
string path = Path.Combine(folder, filename);
fileByte = File.ReadAllBytes(path);
路径是“F:\Web\Opgaver\Skirmer\Hjemmesiden\BETA\Skirmer 17-04-2012\Skirmer 17-04-2012\Billeder\Galleri\F:\Web\Opgaver\Skirmer\Hjemmesiden\BETA\Skirmer 17 -04-2012\Skirmer 17-04-2012\Billeder\Galleri\2011\Vingsted\DSC_0001.JPG"
错误仍然发生。我看到的是 ReadAllBytes 需要一个显示路径的字符串,我得到了,但它仍然显示错误