1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- /// <summary>
- /// 后缀帮助类
- /// </summary>
- public class SuffixHelper
- {
- #region Excel后缀管理
- /// <summary>
- /// Excel后缀枚举
- /// </summary>
- public enum ExcelSuffix
- {
- /// <summary>
- /// 新版后缀
- /// </summary>
- S2007,
- /// <summary>
- /// 老版后缀
- /// </summary>
- S2003,
- }
- /// <summary>
- /// 获取Excel文件后缀
- /// </summary>
- /// <param name="_suffix"></param>
- /// <returns></returns>
- public static string GetExcelSuffixInfo(ExcelSuffix _suffix)
- {
- return _suffix == ExcelSuffix.S2003 ? ".xls" : ".xlsx";
- }
-
- #endregion
- #region 图片后缀管理
- /// <summary>
- /// 图片后缀枚举
- /// </summary>
- public enum PictureSuffix
- {
- PNG,
- png,
- JPG,
- jpg,
- jpeg
- }
- /// <summary>
- /// 获取图片后缀
- /// </summary>
- /// <param name="_suffix"></param>
- /// <returns></returns>
- public static string GetPictureSuffixInfo(PictureSuffix _suffix)
- {
- string resultSuffix = String.Empty;
- switch (_suffix)
- {
- case PictureSuffix.PNG:
- resultSuffix = ".PNG";
- break;
- case PictureSuffix.png:
- resultSuffix = ".png";
- break;
- case PictureSuffix.JPG:
- resultSuffix = ".JPG";
- break;
- case PictureSuffix.jpg:
- resultSuffix = ".jpg";
- break;
- case PictureSuffix.jpeg:
- resultSuffix = ".jpeg";
- break;
- }
- return resultSuffix;
- }
- #endregion
- }
|