創建目錄
void CrateDir(string path)
{
System.IO.Directory.CreateDirectory(path);
}
CrateDir(@"C:\windows\aaa");
寫入文件
void shuchu(string path,string info)
{
FileStream fs = new FileStream(path, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(info);
sw.Flush();
sw.Close();
fs.Close();
}
shuchu(“C:\windows\a.txt”,"123");
作者:Bychentufeiyang