/// <summary> /// html路径 根据文件名 加载Html支持的系统缩略图路劲 /// </summary> /// <param name="FileName"></param> public static string retIcoHtmlPathByFileName(string FileName) { string defaultPath = SysParams.Html_SysImagePath + "unknown-im-ico_03_03.png"; string icoPath = string.Empty; Logic.FileType ft = Logic.Common.FileTypeByFileName(FileName); switch (ft) { case Logic.FileType.gif: goto case Logic.FileType.jpg; case Logic.FileType.bmp: icoPath = "bmp.ico"; break; case Logic.FileType.png: icoPath = "png.ico"; break; case Logic.FileType.jpg: //if (System.IO.File.Exists(FileName)) //{ // icoPath = FileName; //} icoPath = "jpg.ico"; break; case Logic.FileType.xls: icoPath = "excel-im-ico_03_03.png"; break; case Logic.FileType.doc: icoPath = "word-im-ico_03_03.png"; break; case Logic.FileType.ppt: icoPath = "ppt-im-ico_03_03.png"; break; case Logic.FileType.txt: icoPath = "txt.ico"; break; default: icoPath = "unknown-im-ico_03_03.png"; break; } if (!string.IsNullOrEmpty(icoPath)) { defaultPath = SysParams.Html_SysImagePath + icoPath; } return(defaultPath); //this.icoImage = Image.FromFile(icoPath); }
/// <summary> /// 根据文件名 加载文件缩略图Path /// </summary> /// <param name="FileName"></param> public static string retIcoPathByFileName(string FileName) { string icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "unknown-im-ico_03.png"; string sysIcoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath; Logic.FileType ft = Logic.Common.FileTypeByFileName(FileName); switch (ft) { case Logic.FileType.gif: goto case Logic.FileType.jpg; case Logic.FileType.bmp: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "bmp.ico"; break; case Logic.FileType.png: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "png.ico"; break; case Logic.FileType.jpg: //if (System.IO.File.Exists(FileName)) //{ // icoPath = FileName; //} icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "jpg.ico"; break; case Logic.FileType.xls: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "excel-im-ico_03.png"; break; case Logic.FileType.doc: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "word-im-ico_03.png"; break; case Logic.FileType.ppt: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "ppt-im-ico_03.png"; break; case Logic.FileType.txt: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "txt.ico"; break; default: icoPath = AppDomain.CurrentDomain.BaseDirectory + SysParams.Sys_ImagePath + "unknown-im-ico_03.png"; break; } return(icoPath); //this.icoImage = Image.FromFile(icoPath); }