共用方式為


PermissionSet.FromXml(SecurityElement) 方法

定義

透過 XML 編碼,重新建構具有指定狀態的安全性物件。

public:
 virtual void FromXml(System::Security::SecurityElement ^ et);
public virtual void FromXml (System.Security.SecurityElement et);
abstract member FromXml : System.Security.SecurityElement -> unit
override this.FromXml : System.Security.SecurityElement -> unit
Public Overridable Sub FromXml (et As SecurityElement)

參數

et
SecurityElement

用來重新建構安全性物件的 XML 編碼方式。

實作

例外狀況

et 參數為 null

et 參數不是有效的權限項目。

-或- 不支援 et 參數的版本號碼。

範例

下列程式碼範例示範 如何使用 FromXml 方法。 此程式碼範例是提供給 類別之較大範例的 PermissionSet 一部分。

// Display result of ToXml and FromXml operations.
PermissionSet^ ps6 = gcnew PermissionSet( PermissionState::None );
ps6->FromXml( ps5->ToXml() );
Console::WriteLine( "Result of ToFromXml = {0}\n", ps6 );
// Display result of ToXml and FromXml operations.
PermissionSet ps6 = new PermissionSet(PermissionState.None);
ps6.FromXml(ps5.ToXml());
Console.WriteLine("Result of ToFromXml = " + ps6.ToString() + "\n");
' Display result of ToXml and FromXml operations.
Dim ps6 As New PermissionSet(PermissionState.None)
ps6.FromXml(ps5.ToXml())
Console.WriteLine("Result of ToFromXml = " & ps6.ToString() & ControlChars.Lf)

適用於