当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationBuilder.UseWelcomePage方法代码示例

本文整理汇总了C#中IApplicationBuilder.UseWelcomePage方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseWelcomePage方法的具体用法?C# IApplicationBuilder.UseWelcomePage怎么用?C# IApplicationBuilder.UseWelcomePage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApplicationBuilder的用法示例。


在下文中一共展示了IApplicationBuilder.UseWelcomePage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigurePrototype

        public void ConfigurePrototype(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseWelcomePage("/welcome");
            
            app.UseDeveloperExceptionPage();
            
            app.UseDirectoryBrowser(new DirectoryBrowserOptions()
            {
                FileProvider = new PhysicalFileProvider(@"E:\GitHub\Fan.Chinese.MVC\src\Fan.Chinese.MVC\Properties"),
                RequestPath = new PathString("/Properties")
            });

            app.UseStaticFiles();

            app.UseStatusCodePagesWithRedirects("/NotFoundPage.html");

            app.Run(async (context) =>
            {
                if (context.Request.Query.ContainsKey("throw")) throw new Exception("Exception triggered!");
                context.Response.ContentType = "text/html";
                await context.Response.WriteAsync($"<html><body><h2>Nihao {env.EnvironmentName}!</h2>");
                await context.Response.WriteAsync("<ul>");
                await context.Response.WriteAsync("<li><a href=\"/welcome\">Welcome Page</a></li>");
                await context.Response.WriteAsync("<li><a href=\"/Properties\">Browse Property Directory</a></li>");
                await context.Response.WriteAsync("<li><a href=\"/?throw=true\">Throw Exception</a></li>");
                await context.Response.WriteAsync("</ul>");
                await context.Response.WriteAsync("</body></html>");
            });

        }
开发者ID:misssoft,项目名称:Fan.Chinese.MVC,代码行数:30,代码来源:Startup.cs

示例2: Configure

 public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
 {
     loggerFactory.AddConsole();
     app.UseIISPlatformHandler();
     app.UseStaticFiles();
     app.UseWelcomePage();
 }
开发者ID:leloulight,项目名称:Home,代码行数:7,代码来源:Startup.cs

示例3: Configure

        public void Configure(IApplicationBuilder app)
        {
            // Configure the pipeline to include MVC
            app.UseMvc();

            app.UseWelcomePage();
        }
开发者ID:colhountech,项目名称:SoftwareArchitect.AspNet5,代码行数:7,代码来源:Startup.cs

示例4: Configure

        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            app.UseDeveloperExceptionPage();
            app.UseMvcWithDefaultRoute();

            app.UseWelcomePage("/welcome");
            //app.UseRuntimeInfoPage("/info");
            //app.UseIISPlatformHandler();
            
            // Initialise ReactJS.NET. Must be before static files.
            app.UseReact(config =>
            {
                // If you want to use server-side rendering of React components,
                // add all the necessary JavaScript files here. This includes
                // your components as well as all of their dependencies.
                // See http://reactjs.net/ for more information. Example:
                //config
                //    .AddScript("~/Scripts/First.jsx")
                //    .AddScript("~/Scripts/Second.jsx");

                // If you use an external build too (for example, Babel, Webpack,
                // Browserify or Gulp), you can improve performance by disabling
                // ReactJS.NET's version of Babel and loading the pre-transpiled
                // scripts. Example:
                //config
                //    .SetLoadBabel(false)
                //    .AddScriptWithoutTransform("~/Scripts/bundle.server.js");
            });
            
            app.UseStaticFiles();            
        }
开发者ID:ytyukhnin,项目名称:WinterSeminar2016,代码行数:31,代码来源:Startup.cs

示例5: Configure

 public void Configure(IApplicationBuilder app)
 {
     app.UseMvc();
     app.UseSwagger();
     app.UseSwaggerUi();
     app.UseWelcomePage();
 }
开发者ID:herecydev,项目名称:WeatherTest,代码行数:7,代码来源:Startup.cs

示例6: Configure

        public void Configure(IApplicationBuilder app) {
            // To test this sample with Postman, use the following settings:
            // 
            // * Authorization URL: http://localhost:6500/connect/authorize
            // * Access token URL: http://localhost:6500/connect/token
            // * Client ID: postman
            // * Client secret: [blank] (not used with public clients)
            // * Scope: openid email profile roles
            // * Grant type: authorization code
            // * Request access token locally: yes

            app.UseDeveloperExceptionPage();

            app.UseStaticFiles();

            app.UseOAuthValidation();

            app.UseOpenIdConnectServer(options => {
                options.Provider = new AuthorizationProvider();

                // Enable the authorization and token endpoints.
                options.AuthorizationEndpointPath = "/connect/authorize";
                options.TokenEndpointPath = "/connect/token";
                options.AllowInsecureHttp = true;
            });

            app.UseMvc();

            app.UseWelcomePage();
        }
开发者ID:pierre-weceipt,项目名称:AspNet.Security.OpenIdConnect.Samples,代码行数:30,代码来源:Startup.cs

示例7: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseErrorPage();

            app.UseMvcWithDefaultRoute();
            app.UseWelcomePage();
        }
开发者ID:m3smgii2002,项目名称:networkplanner,代码行数:7,代码来源:Startup.cs

示例8: Configure

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (string.Equals(env.EnvironmentName, "Development", StringComparison.OrdinalIgnoreCase))
            {
                app.UseDeveloperExceptionPage();

                app.UseRuntimeInfoPage(); // default path is /runtimeinfo
            }
            else
            {
                // specify production behavior for error handling, for example:
                // app.UseExceptionHandler("/Home/Error");
                // if nothing is set here, exception will not be handled.
            }

            app.UseWelcomePage("/welcome");

            app.Run(async (context) =>
            {
                if(context.Request.Query.ContainsKey("throw")) throw new Exception("Exception triggered!");
                context.Response.ContentType = "text/html";
                await context.Response.WriteAsync("<html><body>Hello World!");
                await context.Response.WriteAsync("<ul>");
                await context.Response.WriteAsync("<li><a href=\"/welcome\">Welcome Page</a></li>");
                await context.Response.WriteAsync("<li><a href=\"/?throw=true\">Throw Exception</a></li>");
                await context.Response.WriteAsync("</ul>");
                await context.Response.WriteAsync("</body></html>");
            });
        }
开发者ID:dvincent,项目名称:Docs,代码行数:29,代码来源:Startup.cs

示例9: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseIISPlatformHandler();

            app.UseMvcWithDefaultRoute();
            app.UseWelcomePage();
        }
开发者ID:squareconnection,项目名称:vNextMongoBlog,代码行数:7,代码来源:Startup.cs

示例10: Configure

        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddDebug();

            app.UseApplicationInsightsRequestTelemetry();

            app.UseApplicationInsightsExceptionTelemetry();

            app.UseErrorHandler(a =>
            {
                a.UseMiddleware<ErrorMiddleware>();
            });

            app.UseWelcomePage("/welcome");
            app.UseRuntimeInfoPage("/runtimeinfo");


            //app.UseErrorPage();


            app.Run(async (context) =>
            {
                if (context.Request.Query.ContainsKey("throw"))
                    throw new AggregateException("Some funny exception, 42");

                await context.Response.WriteAsync("Hello World!");
            });            
        }
开发者ID:rafsan,项目名称:Cancel,代码行数:28,代码来源:Startup.cs

示例11: Configure

        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole();

            app.UseMvcWithDefaultRoute();

            app.UseWelcomePage();
        }
开发者ID:muffycompo,项目名称:openshift3-aspnet-mvc-sample,代码行数:8,代码来源:Startup.cs

示例12: Configure

        public void Configure(IApplicationBuilder app, IApplicationLifetime lifetime, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.Map("/simplewebapi", (app1) => this.ConfigureIIS(app1, lifetime, env, loggerFactory));

            app.UseMvc();

            app.UseWelcomePage();
        }
开发者ID:jsacapdev,项目名称:simplewebapi,代码行数:8,代码来源:Startup.cs

示例13: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseErrorPage();

            app.UseMvc();

            app.UseWelcomePage();
        }
开发者ID:fancyDevelopment,项目名称:Fancy.Samples,代码行数:8,代码来源:Startup.cs

示例14: Configure

 public void Configure(IApplicationBuilder app)
 {
     //app.Run(async (context) =>
     //{
     //    await context.Response.WriteAsync("Hello World!");
     //});
     app.UseWelcomePage();
 }
开发者ID:aracen74,项目名称:Messenger,代码行数:8,代码来源:Startup.cs

示例15: Configure

 public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
 {   
     //Standard configuration based on Microsofts supported Sample
     loggerFactory.AddConsole();
     app.UseErrorPage();
     app.UseMvcWithDefaultRoute();
     app.UseWelcomePage();
 }
开发者ID:hitesh97,项目名称:ASP.net-vnext-samples,代码行数:8,代码来源:Startup.cs


注:本文中的IApplicationBuilder.UseWelcomePage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。