So here's my dilemma. I really don't have much experience working with XML files in VB, but I've had issue with using the settings feature in the past.Basically, I'm looking for the most effective way to store a string that will be read many times through the program's use. I'm currently storing it in an XML file in appdata, but it seems like the program isn't reading/writing the XML file correctly for some users (about 50/50)It really doesn't surprise me that there are issues. Like I said, I don't have much experience working with XML and my code is disgusting to say the least.If someone could point me in the right direction of string storage that will work for every user, not just some of them, that would be perfect. As mentioned above, I've tried my settings, but it seems to be hit and miss.Some history about the string I'm storing: My program pulls a string from my server, then stores that string for later use. Every time a user uses my program, that string is sent back to the server (essentially identifying the user), along with the rest of the data that they're sending.Here's the code I'm using to read/write the XML. Again, it's atrocious, so don't laugh \[code\] Public Shared Sub writeElement(ByVal uname As String) Try Dim iddir As New IO.DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\snip\") System.IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\snip\") If iddir.Exists Then Dim writer As New XmlTextWriter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\snip\snip.xml", System.Text.Encoding.UTF8) writer.WriteStartDocument(True) writer.Formatting = Formatting.Indented writer.Indentation = 2 writer.WriteStartElement("snip") writer.WriteStartElement("id") writer.WriteString(uname) writer.WriteEndElement() writer.WriteEndElement() writer.WriteEndDocument() writer.Close() End If Catch End TryEnd SubPublic Shared Function readElement() Try If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\snip\snip.xml") Then Dim reader As XmlTextReader reader = New XmlTextReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\snip\snip.xml") reader.WhitespaceHandling = WhitespaceHandling.None reader.Read() reader.Read() reader.Read() Dim username = reader.ReadElementString("id") reader.Close() Return username Else Return "ar29qQEmqt4fzFl0HPDW6w6wS+Fb5Czw9vgX/sgDNW4=" End If Catch ex As Exception Return "Z4DgPIUV91DG6MuSN/+k9M+wJ7ff5UkJj9rK3Ct36qI=" End TryEnd Function\[/code\]