3
Reply

problem accessing a file

ckjfr99

ckjfr99

Jul 28 2004 8:04 PM
3.5k
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();

Answers (3)