zoukankan      html  css  js  c++  java
  • ASP.NET CORE 配置中间件允许打开html

    原始方式:

    1  //制定默认打开文件
    2             DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions();
    3             defaultFilesOptions.DefaultFileNames.Clear();
    4             defaultFilesOptions.DefaultFileNames.Add("index.html");
    5             //添加默认中间件,默认打开default。html
    6             app.UseDefaultFiles(defaultFilesOptions);
    7             //添加中间件
    8             app.UseStaticFiles();

    简易方式:

    1  //简易制造中间件
    2             FileServerOptions fileServerOptions = new FileServerOptions();
    3             fileServerOptions.DefaultFilesOptions.DefaultFileNames.Clear();
    4             fileServerOptions.DefaultFilesOptions.DefaultFileNames.Add("index.html");
    5             app.UseFileServer(fileServerOptions);
  • 相关阅读:
    UVa 11389
    uva 1418
    uva 10905 Children's Game
    uva 471
    UVA 1508
    Uva120 Stacks of Flapjacks
    UVA 10020 Minimal coverage
    UVA434
    UVa 311
    决策树算法
  • 原文地址:https://www.cnblogs.com/smartisn/p/14841535.html
Copyright © 2011-2022 走看看