Język

CustomErrorCollection.Get Metoda

Definicja

Pobiera określony CustomErrorelement .

Przeciążenia

Nazwa Opis
Get(String)

CustomError Pobiera obiekt z określonym kodem stanu.

Get(Int32)

CustomError Pobiera obiekt z określonym indeksem.

Get(String)

CustomError Pobiera obiekt z określonym kodem stanu.

public:
 System::Web::Configuration::CustomError ^ Get(System::String ^ statusCode);
public System.Web.Configuration.CustomError Get(string statusCode);
member this.Get : string -> System.Web.Configuration.CustomError
Public Function Get (statusCode As String) As CustomError

Parametry

statusCode
String

Kod stanu HTTP skojarzony z błędem niestandardowym.

Zwraca

Obiekt CustomError z określonym kodem stanu.

Przykłady

W poniższym przykładzie kodu pokazano, jak uzyskać CustomError obiekt z określonym kodem stanu.

Zapoznaj się z przykładem kodu w temacie CustomErrorCollection klasy, aby dowiedzieć się, jak uzyskać kolekcję.

// Get the error with status code 404.
CustomError customError1 = 
    customErrorsCollection["404"];
' Get the error with status code 404.
  Dim customError1 As CustomError = _
  customErrorsCollection("404")

Dotyczy

Get(Int32)

CustomError Pobiera obiekt z określonym indeksem.

public:
 System::Web::Configuration::CustomError ^ Get(int index);
public System.Web.Configuration.CustomError Get(int index);
member this.Get : int -> System.Web.Configuration.CustomError
Public Function Get (index As Integer) As CustomError

Parametry

index
Int32

Indeks kolekcji CustomError obiektu.

Zwraca

Element CustomError z określonym indeksem.

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać CustomError obiekt w określonym indeksie kolekcji.

Zapoznaj się z przykładem kodu w temacie CustomErrorCollection klasy, aby dowiedzieć się, jak uzyskać kolekcję.

// Get the error with collection index 0.
CustomError customError = 
    customErrorsCollection[0];
' Get the error with collection index 0.
  Dim customError As CustomError = _
  customErrorsCollection(0)

Dotyczy