ParserError Construtores

Definição

Inicializa uma nova instância da classe ParserError.Initializes a new instance of the ParserError class.

Sobrecargas

ParserError()

Inicializa uma nova instância da classe ParserError.Initializes a new instance of the ParserError class.

ParserError(String, String, Int32)

Inicializa uma nova instância da classe ParserError usando o texto de erro, o caminho virtual e o número de linha de origem especificados.Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number.

ParserError()

Inicializa uma nova instância da classe ParserError.Initializes a new instance of the ParserError class.

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

Exemplos

O exemplo de código a seguir demonstra como inicializar uma instância vazia da ParserError classe e como usar suas propriedades.The following code example demonstrates how to initialize an empty instance of the ParserError class and how to use its properties.

ParserError MyParserError = new ParserError();

MyParserError.ErrorText = "My Error Text";

MyParserError.Line = 5;

MyParserError.VirtualPath = "MyPath";
Dim myParserError As New ParserError()
myParserError.ErrorText = "My Error Text"
myParserError.Line = 5
myParserError.VirtualPath = "MyPath"

Aplica-se a

ParserError(String, String, Int32)

Inicializa uma nova instância da classe ParserError usando o texto de erro, o caminho virtual e o número de linha de origem especificados.Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number.

public:
 ParserError(System::String ^ errorText, System::String ^ virtualPath, int line);
public ParserError (string errorText, string virtualPath, int line);
new System.Web.ParserError : string * string * int -> System.Web.ParserError
Public Sub New (errorText As String, virtualPath As String, line As Integer)

Parâmetros

errorText
String

O texto da mensagem de erro.The error message text.

virtualPath
String

O caminho virtual do arquivo que está sendo analisado quando ocorreu o erro.The virtual path of the file being parsed when the error occurred.

line
Int32

O número de linha da origem do erro.The line number of the error source.

Comentários

Use o ParserError construtor para inicializar um ParserError objeto com configurações personalizadas.Use the ParserError constructor to initialize a ParserError object with custom settings. O ParserError Construtor tem as seguintes propriedades:The ParserError constructor has the following properties:

  • A ErrorText propriedade, que é uma cadeia de caracteres que contém a mensagem de erro relacionada ao erro do analisador.The ErrorText property, which is a string containing the error message that is related to the parser error.

  • A VirtualPath propriedade, que é uma cadeia de caracteres somente leitura que especifica o caminho virtual do arquivo que contém o erro do analisador.The VirtualPath property, which is a read-only string that specifies the virtual path of the file that contains the parser error.

  • A Line propriedade, que é o número de linha dentro do arquivo no qual esse ParserError objeto foi gerado.The Line property, which is the line number within the file at which this ParserError object was thrown.

Aplica-se a