未能将网站http://localhost4849/配置为使用asp.net4.5。为了使此网络正确的运行,


这因为vs缺少组件。只需要下载相应的组件即可解决问题。


此处进入微软官网


详细如图下图


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于你提供的 URL 模式 `http://localhost/video/{uuid}/{file}.{type}`,你可以通过 ASP.NET MVC5 的路由配置来实现。 首先,在 `RouteConfig.cs` 文件中进行路由配置。你可以使用以下代码来添加一个自定义的路由规则: ```csharp public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "VideoRoute", url: "video/{uuid}/{file}.{type}", defaults: new { controller = "Video", action = "Play" } ); // 其他路由配置... routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } ``` 在上述代码中,我们添加了一个名为 "VideoRoute" 的路由规则,它匹配了 `video/{uuid}/{file}.{type}` 这样的 URL,并将请求发送到 `VideoController` 的 `Play` 方法。 接下来,在控制器中创建一个名为 `VideoController` 的控制器,并在其中添加一个名为 `Play` 的方法: ```csharp public class VideoController : Controller { public ActionResult Play(string uuid, string file, string type) { // 在这里处理视频播放逻辑,可以使用 uuid、file 和 type 参数 return View(); } } ``` 在上述代码中,我们在 `VideoController` 中创建了一个名为 `Play` 的方法,并将 `uuid`、`file` 和 `type` 作为参数。你可以在此方法中处理视频播放逻辑,并使用这些参数。 现在,当你访问类似于 `http://localhost/video/12345678/video.mp4` 的 URL 时,它将匹配到 `VideoController` 的 `Play` 方法,并将参数 `uuid` 设置为 `12345678`,参数 `file` 设置为 `video`,参数 `type` 设置为 `mp4`。 请确保在路由配置时将自定义的路由规则放在一般规则之前,以确保正确匹配。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值