我目前的申请存在问题,我开始认为这只是我的逻辑。即使浏览了这些表格和MSDN,我也无法弄明白。
我尝试使用StreamWriter在我的app目录中创建文本文档,并创建包含该文档的子文件夹。目前它只是将文件转储到我的apps exe目录中。
string runTimeDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string recipeDirectory = Path.Combine(runTimeDirectory, "Recipes");
if (!Directory.Exists(recipeDirectory))
{
//Recipes directory doesnt exist so create it
Directory.CreateDirectory(recipeDirectory);
}
// Write text to file
using (StreamWriter OutputFile = new StreamWriter(recipeDirectory + RecipeName + @".txt"))
{