ASP.NET OWIN的Hello World
示例
使用数据包管理器安装Microsoft.Owin.SelfHost
install-packet Microsoft.Owin.SelfHost
从控制台窗口运行的最低限度的HelloWorldWeb应用程序的代码:
namespace HelloOwin
{
using System;
using Owin;
class Program
{
static readonly string baseUrl = "http://localhost:8080";
static void Main(string[] args)
{
using (Microsoft.Owin.Hosting.WebApp.Start<Startup>(baseUrl))
{
Console.WriteLine("保留要退出的任何键。");
Console.ReadKey();
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Run(ctx =>
{
return ctx.Response.WriteAsync("Hello World");
});
}
}
}
热门推荐
10 婆婆高寿祝福语大全简短
11 开学新人祝福语简短英语
12 发小结婚简短祝福语
13 姐姐生日祝福语漂亮简短
14 高考祝福语简短10字
15 给干爸过年祝福语简短
16 入伙英文祝福语大全简短
17 养生祝福语女生短句简短
18 赠礼贺卡祝福语简短英文