当前位置: 首页>>代码示例>>C#>>正文


C# BundleResponse.get_Content方法代码示例

本文整理汇总了C#中BundleResponse.get_Content方法的典型用法代码示例。如果您正苦于以下问题:C# BundleResponse.get_Content方法的具体用法?C# BundleResponse.get_Content怎么用?C# BundleResponse.get_Content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BundleResponse的用法示例。


在下文中一共展示了BundleResponse.get_Content方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process

 public void Process(BundleContext context, BundleResponse response)
 {
     string content = response.get_Content();
     StringBuilder stringBuilder = new StringBuilder();
     char[] chrArray = new char[1];
     chrArray[0] = '\n';
     string[] strArrays = content.Split(chrArray);
     for (int i = 0; i < (int)strArrays.Length; i++)
     {
         string str = strArrays[i];
         Match match = Regex.Match(str, "url\\([\\\"\\'](.*)\\?embed[\\\"\\']\\)");
         if (match.Success)
         {
             string str1 = match.Result("$1");
             str1 = ConvertCssUrlsToDataUris.CleanPath(str1);
             try
             {
                 str1 = HttpContext.Current.Server.MapPath(str1);
             }
             catch (ArgumentException argumentException)
             {
                 throw new Exception(string.Concat("Illegal Characters : ", str1));
             }
             stringBuilder.AppendLine(str.Replace(match.Result("$0"), this.GetDataUri(str1)));
             stringBuilder.AppendLine(str.Replace("background", "*background"));
         }
         else
         {
             stringBuilder.Append(str);
         }
     }
     response.set_ContentType("text/css");
     response.set_Content(stringBuilder.ToString());
 }
开发者ID:hurricanepkt,项目名称:BundlingDataURI,代码行数:34,代码来源:ConvertCssUrlsToDataUris.cs


注:本文中的BundleResponse.get_Content方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。