CustomErrorCollection.Get Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan yang ditentukan CustomError.
Overload
| Nama | Deskripsi |
|---|---|
| Get(String) |
CustomError Mendapatkan objek dengan kode status yang ditentukan. |
| Get(Int32) |
CustomError Mendapatkan objek dengan indeks yang ditentukan. |
Get(String)
CustomError Mendapatkan objek dengan kode status yang ditentukan.
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
Parameter
- statusCode
- String
Kode status HTTP yang terkait dengan kesalahan kustom.
Mengembalikan
Objek CustomError dengan kode status yang ditentukan.
Contoh
Contoh kode berikut menunjukkan cara mendapatkan CustomError objek dengan kode status yang ditentukan.
Lihat contoh kode dalam CustomErrorCollection topik kelas untuk mempelajari cara mendapatkan koleksi.
// Get the error with status code 404.
CustomError customError1 =
customErrorsCollection["404"];
' Get the error with status code 404.
Dim customError1 As CustomError = _
customErrorsCollection("404")
Berlaku untuk
Get(Int32)
CustomError Mendapatkan objek dengan indeks yang ditentukan.
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
Parameter
- index
- Int32
Indeks CustomError koleksi objek.
Mengembalikan
CustomError dengan indeks yang ditentukan.
Contoh
Contoh kode berikut menunjukkan cara mendapatkan CustomError objek di indeks koleksi yang ditentukan.
Lihat contoh kode dalam CustomErrorCollection topik kelas untuk mempelajari cara mendapatkan koleksi.
// Get the error with collection index 0.
CustomError customError =
customErrorsCollection[0];
' Get the error with collection index 0.
Dim customError As CustomError = _
customErrorsCollection(0)