Domanda

This websie

http://msdn.microsoft.com/en-us/library/vstudio/ms148633(v=vs.100).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2

encrypted XML file using method:

public static void Encrypt(XmlDocument Doc, string ElementToEncrypt, X509Certificate2 Cert)

I want encrypted my whole XML file without second parametr, because I don't want check it my xml file.

Can you give me information, how I should change the code?

È stato utile?

Soluzione

You can use .DocumentElement which will give you the root-node of the document.

Encrypt(doc, doc.DocumentElement.Name, cert)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top