Click here to Skip to main content
15,885,182 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello! I have a problem with xml file. It is, I have a website in c#. in which I have a multiuser chat application. I store every chat messages in a xml file. Now the problem is, whenever I restart the application, all the previous messages appear in the listbox of the chat. By anyhow, I need to clear the contents of xml file everytime I close the application.
Thank you.
P.S I think one solution is to delete xml file eveytime I close the application, and to create it again everytime I start it again. using global.asax page's Application_Start and Application_End. Is it possible by this way?

PLease I am in hurry. :)
Posted

1 solution

Quote:
P.S I think one solution is to delete xml file eveytime I close the application, and to create it again everytime I start it again.
This would work.
You may also delete the file (and create it again) at application startup.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900