.NET 中的 java.lang.IllegalStateException?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2108544/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.IllegalStateException in .NET?
提问by Bob
Description for java.lang.IllegalStateExceptionfrom the Java docs:
java.lang.IllegalStateException来自 Java 文档的描述:
Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.
表示在非法或不适当的时间调用了方法。换句话说,Java 环境或 Java 应用程序未处于所请求操作的适当状态。
Is there an equivalent for IllegalStateExceptionin the .NET-Framework?
IllegalStateException.NET-Framework 中是否有等价物?
回答by Tamas Czinege
System.InvalidOperationException
System.InvalidOperationException
The exception that is thrown when a method call is invalid for the object's current state.
当方法调用对于对象的当前状态无效时抛出的异常。

