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");
});
}
}
}
热门推荐
7 祝福语情人节简短
10 伴娘送亲祝福语简短精辟
11 长辈生日欢快祝福语简短
12 祝福语简短情话高级英文
13 简短结婚的祝福语大全
14 单位生日庆祝祝福语简短
15 中秋发给公公祝福语简短
16 企业开工花束祝福语简短
17 卡片祝福语幽默简短英文
18 祝福语朋友简短恋爱结婚