閱讀英文

共用方式為


LocalFileSettingsProvider.GetPropertyValues 方法

定義

重要

部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。

傳回指定之應用程式執行個體和設定屬性群組的設定屬性值集合。

C#
public override System.Configuration.SettingsPropertyValueCollection GetPropertyValues(System.Configuration.SettingsContext context, System.Configuration.SettingsPropertyCollection properties);

參數

context
SettingsContext

SettingsContext,描述目前應用程式的使用方式。

properties
SettingsPropertyCollection

SettingsPropertyCollection,包含要擷取其值的設定屬性群組。

傳回

SettingsPropertyValueCollection,包含指定設定屬性群組的值。

例外狀況

遇到了使用者範圍的設定,但是目前的組態僅支援應用程式範圍的設定。

備註

方法 GetPropertyValues 也會管理特殊應用程式設定類型 ConnectionString。 連接字串會儲存在由 專案 <connectionstrings>分隔之組態檔的特殊區段中。

警告

LocalFileSettingsProvider 不會使用加密來保存任何設定。 因此,請勿使用此提供者儲存純文本密碼或其他敏感性資訊,而不採取其他預防措施,例如個別加密組態檔中的資訊。 如需詳細資訊,請參閱 使用受保護的組態加密組態資訊

適用於

產品 版本
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 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 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另請參閱