SerializationInfo.GetDateTime(String) SerializationInfo.GetDateTime(String) SerializationInfo.GetDateTime(String) SerializationInfo.GetDateTime(String) Method

定義

DateTime 存放區擷取 SerializationInfo 值。Retrieves a DateTime value from the SerializationInfo store.

public:
 DateTime GetDateTime(System::String ^ name);
public DateTime GetDateTime (string name);
member this.GetDateTime : string -> DateTime
Public Function GetDateTime (name As String) As DateTime

參數

name
String String String String

與要擷取的值相關聯的名稱。The name associated with the value to retrieve.

傳回

name 相關聯的 DateTime 值。The DateTime value associated with name.

例外狀況

name 相關聯的數值無法轉換為 DateTime 值。The value associated with name cannot be converted to a DateTime value.

在目前的執行個體中找不到具有指定名稱的項目。An element with the specified name is not found in the current instance.

備註

如果值為DateTime,或可以轉換成DateTime,該值會傳回; 否則即為InvalidCastException就會擲回。If the value is a DateTime, or can be converted to a DateTime, that value is returned; otherwise, a InvalidCastException is thrown. 所有的轉換由IFormatterConverter與此相關聯SerializationInfoAll conversions are done by the IFormatterConverter associated with this SerializationInfo.

適用於