ProfileService 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
透過網路服務存取 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 服務存取的方法:
要呼叫這些方法,你必須在網頁伺服器啟用設定檔服務,然後將相容於 WCF 的用戶端應用程式連接到網路服務。 關於如何配置設定檔服務的資訊,請參閱 「如何啟用 WCF 輪廓服務」。
當使用者的個人資料屬性被設定時,事件 ValidatingProperties 會被觸發。 你可以為事件建立事件處理器 ValidatingProperties ,來驗證屬性值或動態改變其值。
關於如何從主控台應用程式使用 WCF 設定檔服務的範例,請參見 Walkthrough: Using ASP.NET Application Services。
建構函式
| 名稱 | Description |
|---|---|
| ProfileService() |
初始化 ProfileService 類別的新執行個體。 |
方法
| 名稱 | Description |
|---|---|
| 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) |
事件
| 名稱 | Description |
|---|---|
| ValidatingProperties |
當使用者的設定檔屬性被設定時會發生。 |