PermissionSet.FromXml(SecurityElement) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
透過 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)
參數
用來重新建構安全性物件的 XML 編碼方式。
實作
例外狀況
et
參數為 null
。
範例
下列程式碼範例示範 如何使用 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)