[HttpPost]
public ActionResult Upload(ScormUploadViewModel model)
{
if (ModelState.IsValid)
{
if (model.ScormPackageFile != null)
{
string destinationDirectoryName = "c:\\TSFPreview\\Zinc\\Web\\Project\\ScormPackages";
ZipFile.ExtractToDirectory(model.ScormPackageFile, destinationDirectoryName);
}
}
return View(model);
}
我得到“ZipFile在当前上下文中不存在”??
答案 0 :(得分:0)
您需要将IIS应用程序池配置为运行.NET 4.5,因为该类以前不可用。
这是一条说明:http://technet.microsoft.com/en-us/library/cc754523(v=WS.10).aspx
<compilation
指令仅在调试时有用:http://msdn.microsoft.com/en-us/library/ff400235(v=VS.100).aspx