string strPath = Path.Combine(FilePath, DateTime.Now.ToString("yyyy-MM-dd")); if (!Directory.Exists(strPath)) { Directory.CreateDirectory(strPath);//不存在就创建文件夹 } bool flag = false; using (FileStream fs = new FileStream(strPath+"/c.png", FileMode.Create, FileAccess.Write))