Question

I'm using Visual c# 2010 express edition, and I'm working around files a lot, there's writexml and there's filestream for txt write.

The question is, when I press F5 and try out the program it writes the files correctly, but when I close, do the files get deleted?

If I write a file in this way:

Table.WriteXml("tablexml.xml", XmlWriteMode.WriteSchema);    

Where does the file get stored? will the file remain there for reading if i close the program that was running in debugmode (F5) ?

Was it helpful?

Solution

The question is, when i press f5 and try out the program it writes the files correctly, but when i close, do the files get deleted?

No. The files are only deleted if you delete them.

where does the file get stored? will the file remain there for reading if i close the program that was running in debugmode (F5) ?

Most generally, when you don't specify paths, files are written in what the process considers its working directory. You can set the working directory with:

System.IO.Directory.SetCurrentDirectory(path);

The working directory for your project can be set in the project settings.

OTHER TIPS

Most likely F5 will compile and run your application and does not delete anything else than the application cache itself.

So your Xml will not be deleted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top