C# 生成TXT到程序路径
string result1 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"Result\检测数据" + DateTime.Now.ToString("yyyy/MM/dd_HHmmss") + ".txt"; FileStream fs = new FileStream(result1, FileMode.Append); StreamWriter wr = null; wr = new StreamWriter(fs); wr.WriteLine("测试!"); wr.Close();