I've been working on my statistics script and have i've been trying to change it so that the data it collects is stored in XML rather than a text file. This has been going fine and it works perfectly if you only have one user using the script. If i signed on to WLM with another account it goes wrong.
Currently my XML looks like this:
code:
<Statistics>
<User UserID="357135843">
<Session>0</Session>
<Total/>
<SMC>0</SMC>
<RMC>0</RMC>
</User>
</Statistics>
And when a new User signs on it it will create some more elements like this:
code:
<Statistics>
<User UserID="#######">
<Session>0</Session>
<Total>0Total/>
<SMC>0</SMC>
<RMC>0</RMC>
</User>
<User UserID="#######">
<Session>0</Session>
<Total>0Total/>
<SMC>0</SMC>
<RMC>0</RMC>
</User>
</Statistics>
The problem comes when it tries to write the data to the file, it will still write to the first users part. I could get around this by making separate files for each user but thats not ideal.
After googling for hours i think i need to use the getelementbyid method but i try and it doesn't work!
Sadly i've been fiddling with this so long i can't remember how i got that far and now it doesn't do much and says the object doesn't support this method.
This is a snippet from my code:
code:
if (xmlDoc.getElementById(Messenger.MyUserId) == "null")
{Debug.Trace("User does not Exist")
NewUser();}
else
{Debug.Trace("User exists");}