SerializationInfo.GetDateTime(String) メソッド

定義

DateTime ストアから SerializationInfo 値を取得します。

C#
public DateTime GetDateTime(string name);

パラメーター

name
String

取得する値に関連付けられた名前。

戻り値

name に関連付けられている DateTime 値。

例外

namenullです。

name に関連付けられた値を DateTime 値に変換できません。

指定した名前の要素が、現在のインスタンス内に見つかりません。

注釈

値が の DateTime場合、または に DateTime変換できる場合は、その値が返されます。それ以外の場合 InvalidCastException は がスローされます。 すべての変換は、この SerializationInfoIFormatterConverter関連付けられている によって行われます。

適用対象

製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1