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) ?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top