CustomErrorCollection.Get メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した CustomErrorを取得します。
オーバーロード
| 名前 | 説明 |
|---|---|
| Get(String) |
指定した状態コードを持つ CustomError オブジェクトを取得します。 |
| Get(Int32) |
指定したインデックスを持つ CustomError オブジェクトを取得します。 |
Get(String)
指定した状態コードを持つ CustomError オブジェクトを取得します。
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
パラメーター
- statusCode
- String
カスタム エラーに関連付けられている HTTP 状態コード。
返品
指定した状態コードを持つ CustomError オブジェクト。
例
次のコード例は、指定した状態コードを持つ CustomError オブジェクトを取得する方法を示しています。
コレクションを取得する方法については、 CustomErrorCollection クラスのトピックのコード例を参照してください。
// Get the error with status code 404.
CustomError customError1 =
customErrorsCollection["404"];
' Get the error with status code 404.
Dim customError1 As CustomError = _
customErrorsCollection("404")
適用対象
Get(Int32)
指定したインデックスを持つ CustomError オブジェクトを取得します。
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
パラメーター
- index
- Int32
CustomError オブジェクトのコレクション インデックス。
返品
指定したインデックスを持つ CustomError 。
例
次のコード例は、指定したコレクション インデックスで CustomError オブジェクトを取得する方法を示しています。
コレクションを取得する方法については、 CustomErrorCollection クラスのトピックのコード例を参照してください。
// Get the error with collection index 0.
CustomError customError =
customErrorsCollection[0];
' Get the error with collection index 0.
Dim customError As CustomError = _
customErrorsCollection(0)