ProcessModelSection.UserName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個 Windows 身份的使用者名稱值。
public:
property System::String ^ UserName { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("userName", DefaultValue="machine")]
public string UserName { get; set; }
[<System.Configuration.ConfigurationProperty("userName", DefaultValue="machine")>]
member this.UserName : string with get, set
Public Property UserName As String
屬性值
使用者名稱。 預設值是機械。
- 屬性
範例
以下程式碼範例說明如何存取該 UserName 物業。
// Get the current UserName property value.
string userName =
processModelSection.UserName;
// Set the UserName property to "CustomUser".
processModelSection.UserName = "CustomUser";
' Get the current UserName property value.
Dim userName As String = _
processModelSection.UserName
' Set the UserName property to "CustomUser".
processModelSection.UserName = "CustomUser"
備註
如果存在,則 UserName 定義的 Windows 身份與預設程序不同。 此身份用於執行 ASP.NET 工作者程序。
預設情況下, UserName 會被設定為特殊值的機器,程序則以一個名為 ASPNET 的使用者帳號執行,該帳號在安裝 ASP.NET 後會自動建立。
Password該財產必須與該物業一同UserName使用。
當這些屬性值存在時,會使工作程序以已設定的 Windows 身份執行。
備註
若屬性 UserName 設定為 System,密碼為 AutoGenerate,則會定義一個執行該程序的實體作為管理員帳號,並允許所有在該程序下執行的使用者程式碼 ASP.NET 擁有完整的管理員權限。 所以,請仔細看這個案例,關於允許的權限。