2

これをvb.netに変換するのに助けが必要です...

routes.IgnoreRoute("{*allaspx}", new {allaspx=@".*\.aspx(/.*)?"});
routes.IgnoreRoute("{*robotstxt}", new {robotstxt=@"(.*/)?robots.txt(/.*)?"});

何か案が?

4

2 に答える 2

0

これはどう?

routes.IgnoreRoute("{*allaspx}", New With {.allaspx = ".*\.aspx(/.*)?"})
routes.IgnoreRoute("{*robotstxt}", New With {.robotstxt = "(.*/)?robots.txt(/.*)?"})
于 2013-02-12T10:43:50.160 に答える
0

インポートする必要がありますSystem.Web.Mvc

これは、VB.NET ASP.net Web-Formsアプリ(mvc5を使用)で使用したものです。

Imports System.Web.Mvc

Public Module RouteConfig
    Public Sub RegisterRoutes(ByVal routes As RouteCollection)
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

        ' keep default.aspx for empty url
        routes.IgnoreRoute("")

        routes.MapRoute(
            name:="Default",
            url:="{controller}/{action}/{id}",
            defaults:=New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional}
        )
    End Sub
End Module
于 2019-02-26T12:12:22.533 に答える