ProfileService 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
允許透過 Web 服務存取 ASP.NET 使用者設定檔。
public ref class ProfileService
[System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode=System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Required)]
[System.ServiceModel.ServiceBehavior(ConcurrencyMode=System.ServiceModel.ConcurrencyMode.Multiple, InstanceContextMode=System.ServiceModel.InstanceContextMode.Single, Namespace="http://asp.net/ApplicationServices/v200")]
[System.ServiceModel.ServiceContract(Namespace="http://asp.net/ApplicationServices/v200")]
[System.ServiceModel.ServiceKnownType("GetKnownTypes", typeof(System.Web.ApplicationServices.KnownTypesProvider))]
public class ProfileService
[<System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode=System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Required)>]
[<System.ServiceModel.ServiceBehavior(ConcurrencyMode=System.ServiceModel.ConcurrencyMode.Multiple, InstanceContextMode=System.ServiceModel.InstanceContextMode.Single, Namespace="http://asp.net/ApplicationServices/v200")>]
[<System.ServiceModel.ServiceContract(Namespace="http://asp.net/ApplicationServices/v200")>]
[<System.ServiceModel.ServiceKnownType("GetKnownTypes", typeof(System.Web.ApplicationServices.KnownTypesProvider))>]
type ProfileService = class
Public Class ProfileService
- 繼承
-
ProfileService
- 屬性
備註
類別 ProfileService 可讓您透過 Windows Communication Foundation (WCF) 服務取得和設定使用者的配置檔案屬性。 您可以透過配置檔案屬性保留使用者的自訂資訊。 如需配置檔案屬性的相關資訊,請參閱 配置檔案屬性概觀 ASP.NET。
類別 ProfileService 包含下列方法,這些方法只能透過 WCF 服務存取:
若要呼叫這些方法,您必須在 Web 服務器上啟用設定檔服務,然後將 WCF 相容的用戶端應用程式連線至 Web 服務。 如需如何設定設定檔服務的資訊,請參閱 如何:啟用 WCF 設定檔服務。
ValidatingProperties設定使用者的配置檔案屬性時,就會引發事件。 您可以建立 ValidatingProperties 事件的事件處理常式來驗證屬性值,或動態變更其值。
如需如何從主控台應用程式使用 WCF 設定檔服務的範例,請參閱逐步解說 :使用 ASP.NET 應用程式服務。
建構函式
ProfileService() |
初始化 ProfileService 類別的新執行個體。 |
方法
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
GetAllPropertiesForCurrentUser(Boolean) |
擷取所有可供目前使用者的設定檔服務使用的設定檔屬性和值。 |
GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
GetPropertiesForCurrentUser(IEnumerable<String>, Boolean) |
會擷取目前使用者的指定設定檔屬性和值。 |
GetPropertiesMetadata() |
擷取透過設定檔服務提供的設定檔屬性相關資訊。 |
GetType() |
取得目前執行個體的 Type。 (繼承來源 Object) |
MemberwiseClone() |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
SetPropertiesForCurrentUser(IDictionary<String,Object>, Boolean) |
設定使用者設定檔中指定的屬性值。 |
ToString() |
傳回代表目前物件的字串。 (繼承來源 Object) |
事件
ValidatingProperties |
會在設定使用者設定檔時發生。 |
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應