对路径访问拒绝,要加上具体filename/c.png

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))
原文地址:https://www.cnblogs.com/kunlunmountain/p/9145573.html