ScriptingProfileServiceSection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表設定檔服務設定的設定區段。 此類別無法獲得繼承。
public ref class ScriptingProfileServiceSection sealed : System::Configuration::ConfigurationSection
public sealed class ScriptingProfileServiceSection : System.Configuration.ConfigurationSection
type ScriptingProfileServiceSection = class
inherit ConfigurationSection
Public NotInheritable Class ScriptingProfileServiceSection
Inherits ConfigurationSection
- 繼承
範例
以下範例展示了如何在設定檔中宣告式地指定類別屬性 ScriptingProfileServiceSection 的值。
<system.web.extensions>
<scripting>
<webServices>
<profileService enabled="true"
readAccessProperties="FirstName,LastName"
writeAccessProperties="FirstName,LastName" />
</webServices>
</scripting>
</system.web.extensions>
以下範例說明如何以程式方式存取該 ScriptingProfileServiceSection 區段。
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the external Web services section.
ScriptingWebServicesSectionGroup webServicesSection =
(ScriptingWebServicesSectionGroup)configuration.GetSectionGroup(
"system.web.extensions/scripting/webServices");
// Get the profile service section.
ScriptingProfileServiceSection profileSection =
webServicesSection.ProfileService;
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
' Get the external Web services section.
Dim webServicesSection As ScriptingWebServicesSectionGroup = _
CType(configuration.GetSectionGroup( _
"system.web.extensions/scripting/webServices"), ScriptingWebServicesSectionGroup)
' Get the profile service section.
Dim profileSection _
As ScriptingProfileServiceSection = _
webServicesSection.ProfileService
備註
ScriptingProfileServiceSection 類別允許您程式化存取並修改配置區塊中的 profileService 元素,適用於使用 AJAX 功能的 ASP.NET 應用程式。
設定檔服務用於取得並設定與當前請求相關的使用者身份設定檔屬性。 這表示該個人檔案服務對已認證的使用者有效。 當設定檔啟用(或啟用)匿名識別功能時,它也能對匿名使用者有效。
建構函式
| 名稱 | Description |
|---|---|
| ScriptingProfileServiceSection() |
初始化 ScriptingProfileServiceSection 類別的新執行個體。 |