gpt4 book ai didi

C# 创建名称为 的文件

转载 作者:太空宇宙 更新时间:2023-11-03 20:10:02 24 4
gpt4 key购买 nike

这可能是个愚蠢的问题,但我已经用谷歌搜索了大约 15 分钟。实际上,“调试”这个词并不常见,这就是为什么谷歌搜索结果对我没有帮助。

我使用的是 Visual Studio 2012。我有一个简单的 C# 代码,可以将一些输出打印到 .post 文件:

string sCurrPath = Directory.GetCurrentDirectory()+"Posting_0";
TextWriter tw = new StreamWriter(sCurrPath + ".post");
tw.WriteLine("something");
tw.Close();

这是 for 循环的一部分,但我认为它不重要。

我希望找到一个名为“Posting_0.post”但我得到的是一个名为“DebugPosting_0.post”

也许它在 Visual Studio 首选项中的某处。

当我尝试在 google 中寻找答案时,它误解了“调试”的上下文。

提前致谢。

最佳答案

使用 Path.Combine(Directory.GetCurrentDirectory(), "Posting_0") 而不是 +

关于C# 创建名称为 <Debug><GivenName> 的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20616914/

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