我已经通过stackoverflow上的其他条目,但没有一步一步的方法来解决这个问题?有那么复杂吗?
我想解压缩到我本地驱动器上的一个文件夹,也得到这个错误。我必须在我的 webconfig 中做些什么吗?
我应该对我的整个 C 盘有写权限吗?那不会很好吗?
谢谢
public ActionResult Upload(ScormUploadViewModel model)
{
if (ModelState.IsValid)
{
if (model.ScormPackageFile != null)
{
//string destinationDirectoryName = "c:\\TSFPreview\\Zinc\\Web\\Project\\ScormPackages";
string zipCurFile = model.ScormPackageFile.FileName;
//string origZipFileName = zipCurFile.Remove(zipCurFile.Length - model.ScormPackageFile.FileName);
string destinationDirectoryName = Path.GetFileNameWithoutExtension(zipCurFile);
//Directory.CreateDirectory(destinationDirectoryName);
Directory.CreateDirectory("C:\\Testing");
StreamReader streamReader = new StreamReader("C:\\Testing"); //here get that error
streamReader.Read();
using (GZipStream Decompress = new GZipStream(model.ScormPackageFile.InputStream, CompressionMode.Decompress))
{
//Decompress.CopyTo("C:\\Testing");
}
}
}
return View(model);
}