1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| XElement root = new XElement("Rapport",
new XElement("General", new XElement[] { new XElement("Hostname", Computer_Hostname),
new XElement("Date", String.Format("{0:dd/MM/yyyy}", DateTime.Today))}),
new XElement("Computer", new XElement[] { new XElement("Fabriquant", Computer_Fabriquant),
new XElement("Modele", Computer_Modele),
new XElement("Nb_serie", Computer_Nb_serie),
new XElement("Processeur", Computer_Processeur),
new XElement("Nb_coeur", Computer_Nb_coeur),
new XElement("Frequence", Computer_Frequence),
new XElement("Memoire", Computer_Memoire) }),
new XElement("OS", new XElement[] { new XElement("OS", OS_OS),
new XElement("Bits", OS_Bits),
new XElement("Pack", OS_Pack),
new XElement("Proxy", OS_Proxy),
new XElement("SNMP", OS_SNMP),
new XElement("SNMP_Public", OS_SNMP_Public)}
)
);
XElement listingReseau = new XElement("Network");
for (int i = 0; i < 4; i++)
{
XElement connect = new XElement("Connection");
connect = lectureNetwork(i);
if (connect != null)
{ listingReseau.Add(lectureNetwork(i)); }
}
root.Add(listingReseau);
root.Save(Application.StartupPath + |
Partager