1.文件夹是否存在
if(!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
2.文件的写入
using( FileStream fs = new FileStream(fullpath,FileMode.CreateNew))
{
byte [] data = Convert.FromBase64String(str);
fs.Write(data,0,data.Length);
fs.Flush();
fs.Close();
}
3.当前文件的路径
string path = Directory.GetCurrentDirectory();