MVC 增加手机站

首先在全局路由(RouteConfig)中加入以下图片中的代码。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4cAAAFUCAIAAAAYut5pAAAgAElEQVR4nO3dy8ouy13H8b6J9yqEDByJ7okTb8CL8AYcOQk4XwQPk2wUheV2FDAI2UEHe5YgCVv2wDgIxoARDImTKBHBQDt4szr11v9Q/zp0Vx++H5pFv/VUV1Ufnn5+q/s5LKvh1/7ob14npyTuk08+aVgKce8+yObTP1Ov5dujshG5rF8oO7LajHe0DdK3LL+csnn551a4/et49+5Xk/qQXzMtfC235uWfyVCVUaqFlqrKmfcvL9u/aYmsk83LBf1y2Y5VRz6UFaZ/yvrqn8U2s5qyL6uy35HVe1zPzgWAiX5uOOikRiq9k0hSRFyWZVPLB+qfEbX1U2pgciKjrGAl2kgGha9nzwLAXKRSjKFe0UQn61opAAD3QyoFAADAfKRSAAAAzEcqBQAAwHykUgAAAMxHKj0XPjwLAACeqSWVZl9NyveVjkUwBQAAD9SbSq35IFKpRCoFAAAPVJ1K5Q87qfNBpFIVwRQAADxNXSp9zZ1W+iSVjtL/e5IAAADXMiyV8r7SgQigAADgaSpS6ZY7ZQBti6QrqdRAKgUAAE9Tl0rTKS1v7p5UqiKVAgCAp6n+tNPKZ/B3RiQFAAAPVJ1Ks2ul1gXUIFKpZKVS0ioAALixlmulA5FKM070JJUCAIAbI5UCAABgPlIpAAAA5iOVAgAAYD5SKQAAAOYjlQIAAGA+UiluiO8rAADgclpSafa9pM1fVrqSSk9v+SCbr128dsEeRFIAAK6oN5Xy205nMzyTZam0ZzxtY6tdilQKAMAVVadS57IoqfQMHp5KiaQAAFxUXSp9zZ2k0v1YETC7Ca7OO7fL/UI/yVUNSTYYHNKQNVpJpQAAXNaYVMr7SgdSE5icVwtXLZZVLa6OJ/u3qs1swf3WKLIuAADgtCpS6ZY7uVa6q85YqS7uXMUMjscKl9k1TmecxQH3r5FaGQAAXEJdKk0ntUJt96RSaY9UWtWdWkGm0mDu3Cm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CAABgPlIpAAAA5rNS6f8DlHUf6VfUdWEAAAAASUVORK5CYII=" alt="" width="675" height="254" />

代码为:

 ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new CustomViewEngine());

然后紧接着在下面加入:

 public class CustomViewEngine : RazorViewEngine
{
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
{
ViewEngineResult result = null;
var request = controllerContext.RequestContext.HttpContext.Request; string input = request.ServerVariables["HTTP_USER_AGENT"];
Regex regex1 = new Regex("(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|ucweb|MicroMessenger", RegexOptions.IgnoreCase | RegexOptions.Multiline);
Regex regex2 = new Regex("1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-", RegexOptions.IgnoreCase | RegexOptions.Multiline);
if (regex1.IsMatch(input) || regex2.IsMatch(input.Substring(, )))
{
WeixinHelper.RegisterByAgent(input);
result = base.FindView(controllerContext, viewName + ".Mobile", masterName, useCache);
}
if (result == null || result.View == null)
{
result = base.FindView(controllerContext, viewName, masterName, useCache);
} return result;
}
}

以上就完成了,只需要在接下来的工作中新建试图的时候加上.Mobile。就完成了手机站的配置。

上一篇:linux命令之seq


下一篇:C++ 可以多个函数声明