コード例 #1
0
        public static TagBuilder Best(string bestName, Guid id)
        {
            var image = Urls.ContentRoot(
                GetBestNameFull(bestName) + id + Urls.PhotoExt);

            return(HtmlControls.Image(image));
        }
コード例 #2
0
 public static string SaveMessageImage(HttpFileCollectionBase files, int userID)
 {
     foreach (string file in files)
     {
         var hpf = files[file];
         if (hpf.ContentLength == 0)
         {
             return(string.Empty);
         }
         var fileName = Path.GetFileName(hpf.FileName);
         var sysName  = GetMessageFileSys(userID, fileName);
         SaveFileWithResize(hpf, sysName, 800);
         return(Urls.ContentRoot(Urls.FullMessageImage + userID + "/" + fileName));
     }
     return(string.Empty);
 }
コード例 #3
0
        public static string GetFileUrl(int fileID)
        {
            var directoryInfo = GetDirectoryInfo(fileID);

            if (!directoryInfo.Exists)
            {
                return(null);
            }
            var fileInfos = directoryInfo.GetFiles();

            if (fileInfos.Length == 0)
            {
                return(null);
            }
            return(Urls.ContentRoot(GetInnerUserFilePath(fileID) + fileInfos[0].Name));
        }