HttpCompileException 构造函数

定义

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

重载

HttpCompileException()

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

HttpCompileException(String)

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

HttpCompileException(CompilerResults, String)

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

HttpCompileException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class with a specified error message and a reference to the inner exception that is the cause of this exception.

HttpCompileException()

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

public:
 HttpCompileException();
public HttpCompileException ();
Public Sub New ()

适用于

HttpCompileException(String)

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

public:
 HttpCompileException(System::String ^ message);
public HttpCompileException (string message);
new System.Web.HttpCompileException : string -> System.Web.HttpCompileException
Public Sub New (message As String)

参数

message
String

发生错误时要指定的异常消息。The exception message to specify when the error occurs.

适用于

HttpCompileException(CompilerResults, String)

初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class.

public:
 HttpCompileException(System::CodeDom::Compiler::CompilerResults ^ results, System::String ^ sourceCode);
public HttpCompileException (System.CodeDom.Compiler.CompilerResults results, string sourceCode);
new System.Web.HttpCompileException : System.CodeDom.Compiler.CompilerResults * string -> System.Web.HttpCompileException
Public Sub New (results As CompilerResults, sourceCode As String)

参数

results
CompilerResults

包含编译器输出和错误消息的 CompilerResultsA CompilerResults containing compiler output and error information.

sourceCode
String

发生错误时正在编译的源代码所属的文件的路径。The path to the file that contains the source code being compiled when the error occurs.

注解

对于 sourceCode 参数,可以传递任何描述性为错误情况的字符串信息; 不检查文件或路径。For the sourceCode parameter, you can pass any string information that is descriptive to the error condition; there are no checks on file or path. SourceCode属性返回作为参数值传递的字符串。The SourceCode property returns the string that was passed as the parameter value. 如果使用不需要参数的构造函数 sourceCode ,则 SourceCode 属性为 nullIf you use a constructor that does not require the sourceCode parameter, the SourceCode property is null.

适用于

HttpCompileException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 HttpCompileException 类的新实例。Initializes a new instance of the HttpCompileException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 HttpCompileException(System::String ^ message, Exception ^ innerException);
public HttpCompileException (string message, Exception innerException);
new System.Web.HttpCompileException : string * Exception -> System.Web.HttpCompileException
Public Sub New (message As String, innerException As Exception)

参数

message
String

解释异常原因的错误消息。The error message that explains the reason for the exception.

innerException
Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 不为 null,则在处理内部异常的 catch 块中引发当前异常。If innerException is not null, the current exception is raised in a catch block that handles the inner exception.

适用于