You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Demo/Demo.WinForms/Program.cs

31 lines
891 B

using Demo.Resources;
using System;
using System.Threading.Tasks;
using System.Windows.Forms;
using Unosquare.Labs.EmbedIO;
using Unosquare.Labs.EmbedIO.Modules;
namespace Demo.WinForms
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Task.Factory.StartNew(async () =>
{
using (var server = new WebServer("http://*:5000"))
{
server.RegisterModule(new ResourceFilesModule(Resource.Assembly, Resource.WebFolder));
await server.RunAsync();
}
});
Application.Run(new MainForm());
}
}
}