[英]FormatException in while loop c#/asp.net mvc application
What is the problem with this conditional loop: 这个条件循环有什么问题:
while (System.IO.File.Exists(relPath)){ ... }
It trows an exception when it starts: 它在启动时引发异常:
Exception Details: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list 异常详细信息:System.FormatException:索引(从零开始)必须大于或等于零且小于参数列表的大小
The relPath string value is a "/Temp/pdfs/file.ext". relPath字符串值是“ /Temp/pdfs/file.ext”。 Any help? 有什么帮助吗?
The System.FormatException is thrown because a substitution marker was not found in the argument list. 抛出System.FormatException,因为在参数列表中找不到替换标记。 If more arguments were provided, the program would not throw an exception. 如果提供了更多参数,该程序将不会引发异常。
My answer is copied from here , which provides sample code and shows the simple fix. 我的答案从此处复制,其中提供了示例代码并显示了简单的修复方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.