예제 #1
0
        /// <summary>
        /// 得到静态文件+版本号
        /// <para>配置文件需设置:JsAndCssFileEdition</para>
        /// </summary>
        /// <param name="helper">UrlHelper</param>
        /// <param name="path">Js 或者CSS路径</param>
        /// <returns>路径</returns>
        public static string JsCssFile(this UrlHelper helper, string path)
        {
            ConfigFileOperator _appConfig = new ConfigFileOperator(ProgramMode.WebForm);
            var _jsAndCssFileEdition      = _appConfig.GetSetting("JsAndCssFileEdition");

            if (string.IsNullOrEmpty(_jsAndCssFileEdition))
            {
                _jsAndCssFileEdition = StringHelper.Unique();
            }

            path += string.Format("?v={0}", _jsAndCssFileEdition);
            return(helper.StaticFile(path));
        }
예제 #2
0
 public void Instance()
 {
     config = new ConfigFileOperator(ProgramMode.WinForm);
 }