Note that there are some explanatory texts on larger screens.

plurals
  1. POXMLSerializer is not writing elements in a list
    primarykey
    data
    text
    <p>I am writing a program that will basically make a xml copy of most things in the local computer SAM store for users.</p> <p>Currently it only prints a XMLElement for each user but it does not print the attributes for them.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;WindowsUserList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;windowsUserEntry /&gt; &lt;windowsUserEntry /&gt; ... &lt;windowsUserEntry /&gt; &lt;windowsUserEntry /&gt; &lt;/WindowsUserList&gt; </code></pre> <p>This is my main code, the check box text has formatted name for a search as its text (accounting* for example to get users accounting1, 2, 3 ect..)</p> <pre><code>windowsUserList listUsers = new windowsUserList(); PrincipalContext context = new PrincipalContext(ContextType.Machine, Settings.Default.ipAddress, Settings.Default.username, Settings.Default.password); foreach (CheckBox cbx in groupBox1.Controls.OfType&lt;CheckBox&gt;()) { if (cbx.Checked) { UserPrincipal usr = new UserPrincipal(context); if (cbx.Text == "") { usr.Name = txtCustom.Text; } else { usr.Name = cbx.Text; } PrincipalSearcher search = new PrincipalSearcher(usr); PrincipalSearchResult&lt;Principal&gt; results = search.FindAll(); foreach (Principal result in results) { listUsers.AddUser(new windowsUserEntry((UserPrincipal)result)); } // foreach (Principal result in results) }//if (cbx.Checked) }//foreach (CheckBox cbx in groupBox1.Controls.OfType&lt;CheckBox&gt;()) XmlSerializer s = new XmlSerializer(typeof(windowsUserList)); TextWriter w = new StreamWriter(dlgSave.OpenFile()); s.Serialize(w, listUsers); w.Close(); </code></pre> <p>The code for windows user list/entry is very long so I posted it to <a href="http://pastebin.com/d7b187c02" rel="nofollow noreferrer">pastebin</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload