Problem accessing a file
When I'm runing my program in VS i'm creating a xml-file. When I then restart my program and trying to delete the file I get the error that the file is used by another process. How do i get ridd of this problem?? This is how my file is created:
XmlTextWriter writer = new XmlTextWriter("jhk.xml", null);
writer.Formatting = Formatting.Indented;
writer.WriteStartDocument();
writer.WriteStartElement("user");
//writing a encrypted version of name and password
writer.WriteElementString("name", crypt.Encrypt(tBUsername.Text.Trim(), "test"));
writer.WriteElementString("password", crypt.Encrypt(tBPassword.Text.Trim(), "test"));
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
writer.Close();
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ckjfr9910 reputationPosted Aug 2, 2004, 11:28 PM EDT
scyphe66672 reputationPosted Aug 3, 2004, 4:36 PM EDT
ckjfr9910 reputationPosted Aug 5, 2004, 1:36 AM EDT