Preferences.Get 方法

定義

多載

名稱 Description
Get(String, String, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Int64, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Int32, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Double, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, DateTime, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Boolean, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Single, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Single)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Int64)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Int32)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Double)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, DateTime)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, Boolean)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

Get(String, String, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static string Get(string key, string defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.String

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.String

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Int64, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static long Get(string key, long defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.Int64

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.Int64

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Int32, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static int Get(string key, int defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.Int32

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.Int32

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Double, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static double Get(string key, double defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.Double

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.Double

給定鍵值,或若不存在則為預設值。

適用於

Get(String, DateTime, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static DateTime Get(string key, DateTime defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.DateTime

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.DateTime

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Boolean, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static bool Get(string key, bool defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.Boolean

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.Boolean

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Single, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static float Get(string key, float defaultValue, string sharedName);

參數

key
System.String

偏好鍵。

defaultValue
System.Single

如果金鑰不存在,預設值會回傳。

sharedName
System.String

共用容器金鑰。

傳回

System.Single

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Single)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static float Get(string key, float defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.Single

如果金鑰不存在,預設值會回傳。

傳回

System.Single

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Int64)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static long Get(string key, long defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.Int64

如果金鑰不存在,預設值會回傳。

傳回

System.Int64

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Int32)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static int Get(string key, int defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.Int32

如果金鑰不存在,預設值會回傳。

傳回

System.Int32

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Double)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static double Get(string key, double defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.Double

如果金鑰不存在,預設值會回傳。

傳回

System.Double

給定鍵值,或若不存在則為預設值。

適用於

Get(String, DateTime)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static DateTime Get(string key, DateTime defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.DateTime

如果金鑰不存在,預設值會回傳。

傳回

System.DateTime

給定鍵值,或若不存在則為預設值。

適用於

Get(String, Boolean)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static bool Get(string key, bool defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.Boolean

如果金鑰不存在,預設值會回傳。

傳回

System.Boolean

給定鍵值,或若不存在則為預設值。

適用於

Get(String, String)

取得指定索引鍵的值,如果索引鍵不存在,則為指定的預設值。

public static string Get(string key, string defaultValue);

參數

key
System.String

偏好鍵。

defaultValue
System.String

如果金鑰不存在,預設值會回傳。

傳回

System.String

給定鍵值,或若不存在則為預設值。

適用於