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.
30 lines
897 B
30 lines
897 B
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(IoT.Resources.Resource.Assembly, IoT.Resources.Resource.WebFolder));
|
|
await server.RunAsync();
|
|
}
|
|
});
|
|
Application.Run(new MainForm());
|
|
}
|
|
}
|
|
} |