HttpParseException 构造函数

定义

初始化 HttpParseException 类的新实例。

重载

名称 说明
HttpParseException()

初始化 HttpParseException 类的新实例。

HttpParseException(String)

使用指定的错误消息初始化类的新实例 HttpParseException

HttpParseException(String, Exception)

使用指定的错误消息和对内部的引用初始化类的新实例 HttpParseException

HttpParseException(String, Exception, String, String, Int32)

使用有关要编译的 HttpParseException 源代码以及发生异常的行号的特定信息初始化类的新实例。

HttpParseException()

初始化 HttpParseException 类的新实例。

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

适用于

HttpParseException(String)

使用指定的错误消息初始化类的新实例 HttpParseException

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

参数

message
String

在发生错误时要指定的异常消息。

示例

以下示例演示了 HttpException 构造函数的使用。 有关完整的工作代码示例,请参阅 HttpParseException 概述主题。

throw new HttpParseException("This custom HtmlSelect control" +                                                  "requires child elements of the form \"MyCustomOption\"");
Throw New HttpParseException("This custom HtmlSelect control" & _ 
         "requires child elements of the form ""MyCustomOption""")

适用于

HttpParseException(String, Exception)

使用指定的错误消息和对内部的引用初始化类的新实例 HttpParseException

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

参数

message
String

在发生错误时要指定的异常消息。

innerException
Exception

是当前异常原因的异常。 如果未 innerExceptionnull 参数,则会在处理内部异常的 catch 块中引发当前异常。

适用于

HttpParseException(String, Exception, String, String, Int32)

使用有关要编译的 HttpParseException 源代码以及发生异常的行号的特定信息初始化类的新实例。

public:
 HttpParseException(System::String ^ message, Exception ^ innerException, System::String ^ virtualPath, System::String ^ sourceCode, int line);
public HttpParseException(string message, Exception innerException, string virtualPath, string sourceCode, int line);
new System.Web.HttpParseException : string * Exception * string * string * int -> System.Web.HttpParseException
Public Sub New (message As String, innerException As Exception, virtualPath As String, sourceCode As String, line As Integer)

参数

message
String

在发生错误时要指定的异常消息。

innerException
Exception

是当前异常原因的异常。 innerException如果没有null,则当前异常在处理内部异常的块中catch引发。

virtualPath
String

异常的虚拟路径。

sourceCode
String

发生异常时正在编译的源代码。

line
Int32

发生异常的行号。

适用于