Exemplo n.º 1
0
        /// <summary>获取上传文件要保存的路径名</summary>
        public static string GetUploadFilePath(string folderName, string fileName)
        {
            string folder = string.Format("~/Files/{0}", folderName);

            fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
            fileName = string.Format("{0}-{1}", DateTime.Now.ToString("yyyyMMddHHmmssfffffff"), fileName);
            return(Asp.ResolveUrl(string.Format("{0}/{1}", folder, fileName)));
        }