1.创建目录。

 

 

 

 1   string path = @"c:\wtqCreate";
 2             string pathTxt = path + @"\my.txt";
 3             if (Directory.Exists(path))
 4             {
 5                  
 6                 Directory.Delete(path,true);
 7                 Directory.CreateDirectory(path);
 8                 using (StreamWriter sw = File.CreateText(pathTxt))
 9                 {
10                     sw.WriteLine("my name is wtq");
11                     sw.WriteLine("and what's your name");
12                     sw.WriteLine("my name is wwttqq");
13                     sw.WriteLine("I Can do everyThing");
14                 }
15             }

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-08-21
  • 2021-05-02
  • 2022-12-23
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案