C#如何在指定文件夹中创建一个TXT文件?
代码如下图所示
FileStream fs1 = new FileStream(textBox2.Text + "\\set.txt",FileMode.Create,FileAccess.Write); System.IO.File.SetAttributes(textBox2.Text + "\\set.txt", FileAttributes.Normal); StreamWriter sw = new StreamWriter(fs1); sw.WriteLine("112233");//开始写入值 sw.Close(); fs1.Close();