更新时间:2022-11-26 13:54:38
如果要忽略文件夹,可以这样写:
If you want to ignore folder you can write like this:
routes.IgnoreRoute("Images/{*pathInfo}");
如果只想忽略文件夹中的某些文件,可以使用此 IgnoreRoute()
像这样:
if you want to ignore only certain files in folder you can use this overload of IgnoreRoute()
like this:
routes.IgnoreRoute("{Images}", new { assets = @".*\.(jpeg|gif|jpg)(/.)?" });
如您所见,约束
参数可以是像 RegExp
这样实现。
As you can see constraints
parameter can be implemented like RegExp
.