标签:color res convert 文件压缩 pos ica adf public bsp
Controller层
public void DownLoadFiles(string ids) { try { string str = Convert.ToString(ids); if (ids != null && !string.IsNullOrWhiteSpace(str)) { List<string> strPath = new List<string>(); string[] idlist = str.Substring(0, str.Length - 1).Split(‘,‘); foreach (string id in idlist) { var list = StudengService.LoadEntites(o => o.Stu_ID == Convert.ToInt32(id)); if (list != null && list.Count() > 0) { foreach (var model in list) { var detail = detailService.LoadEntites(o => o.ID == Convert.ToInt32(id)).First(); if (detail != null) { string strAddress = model.Data_Address; strPath.Add(Server.MapPath(@"\Content\Files\") + strAddress); } } } } ZipFileDownload(strPath.ToArray(), "资料文件.zip"); } } catch (Exception ex) { } }
View层
<span class="btn"><a href="#" class="btn-download">下载</a></span> var jsonData = ""; $(".checkchild:checked").each(function () { jsonData += $(this).val() + ","; }); if (jsonData.length > 0) { window.location.href = "/Data/DownLoadFiles?ids=" + jsonData; }else{ $.alert({ title: "Message", content: "请勾选要下载的数据", }); }
标签:color res convert 文件压缩 pos ica adf public bsp
原文地址:https://www.cnblogs.com/zlkkkkkk/p/10326647.html