//附件 void ShowTaskFile() { if (proMod != null && !proMod.Attach.Trim().Equals("")) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("ExtName")); dt.Columns.Add(new DataColumn("FileName")); dt.Columns.Add(new DataColumn("Path")); string[] fileurls = proMod.Attach.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < fileurls.Length; i++) { if (!string.IsNullOrEmpty(fileurls[i])) { string[] datas = new string[3]; datas[0] = GroupPic.GetExtNameMini(Path.GetExtension(fileurls[i]).Replace(".", "")); string fname = Path.GetFileName(fileurls[i]); datas[1] = fname.Length > 6 ? fname.Substring(0, 5) + "..." : fname; datas[2] = fileurls[i]; dt.Rows.Add(datas); } } RShowFilelist.DataSource = dt; RShowFilelist.DataBind(); } }
public string GetFName() { string result = ""; string fname = Eval("Name").ToString(); result += GroupPic.GetExtNameMini(fname); result += fname; //int type = Convert.ToInt32(Eval("Type"));//1为文件夹 return(result); }
public string GetLink() { string name = Eval("Name").ToString(); string path = GetVPath(Eval("FullPath").ToString()).TrimStart('/'); string reuslt = GroupPic.GetExtNameMini(Eval("ExName").ToString()); switch (Eval("ExName").ToString().ToLower()) { case "filefolder": return(reuslt + "<a href='ResList.aspx?vdir=" + path + "'>" + name + "</a>"); default: //支持预览 return(reuslt + "<span>" + name + "</span>"); } }
public MvcHtmlString GetUrl(DataRow dr) { string result = ""; int filetype = Convert.ToInt32(dr["FileType"]); if (filetype == 2) { result = GroupPic.GetExtNameMini("filefolder"); } else if (SafeSC.IsImage(dr["FileName"].ToString())) { string imgurl = CurrentDir + dr["SFileName"]; result = "<img src='" + imgurl + "' style='width:30px;height:30px;display:block;' />"; } else { result = GroupPic.GetExtNameMini(Path.GetExtension(DataConverter.CStr(dr["FileName"]))); } return(MvcHtmlString.Create(result)); }