gpt4 book ai didi

c# - Visual C# 2010 Express Edition - 当我按 F5 时,是否存储创建的文件?

转载 作者:太空宇宙 更新时间:2023-11-03 21:33:05 26 4
gpt4 key购买 nike

我使用的是 Visual c# 2010 速成版,我经常处理文件,有 writexml 和用于 txt 写入的文件流。

问题是,当我按 F5 并试用程序时,它会正确写入文件,但是当我关闭时,文件会被删除吗?

如果我这样写一个文件:

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

文件存储在哪里?如果我关闭以 Debug模式 (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?

没有。这些文件只有在您删除它们时才会被删除。

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

大多数情况下,当您不指定路径时,文件将写入进程认为是其工作目录的位置。您可以设置工作目录:

System.IO.Directory.SetCurrentDirectory(path);

可以在项目设置中设置项目的工作目录。

关于c# - Visual C# 2010 Express Edition - 当我按 F5 时,是否存储创建的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23231753/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com