示例#1
0
        /// <summary>
        /// 获得文件最终存储名
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static string GetFinalFileName(string fileName)
        {
            // 拓展名 txt
            var extension = Path.GetExtension(fileName);

            // 文件最终存储路径,日期+随机数
            var finalFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + DiskUtil.RandomString(4);

            if (!string.IsNullOrEmpty(extension))
            {
                finalFileName += extension;
            }

            return(finalFileName);
        }
示例#2
0
        /// <summary>
        /// 预约单号生成规则:yyyyMMddHHmmss1234
        /// </summary>
        /// <returns></returns>
        public static string GetFormNumber()
        {
            var getFormNumber = DateTime.Now.ToString("yyyyMMddHHmmss") + DiskUtil.RandomCode(4);

            return(getFormNumber);
        }