static void Main(string[] args) { ConsoleHelper.Title = "SAEA.MVCTest"; var mvcConfig = SAEAMvcApplicationConfigBuilder.Read(); mvcConfig.Count = 1; mvcConfig.Port = 8089; SAEAMvcApplication mvcApplication = new SAEAMvcApplication(mvcConfig); //设置默认控制器 //mvcApplication.SetDefault("home", "index"); //mvcApplication.SetDefault("index.html"); //限制 //mvcApplication.SetForbiddenAccessList("/content/"); //mvcApplication.SetForbiddenAccessList(".jpg"); mvcApplication.Start(); mvcApplication.Stop(); mvcApplication.Start(); ConsoleHelper.WriteLine($"MVC已启动!\t\r\n访问请输入http://127.0.0.1:{mvcConfig.Port}/{{controller}}/{{action}}"); ConsoleHelper.WriteLine("回车结束!"); ConsoleHelper.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "SAEA.WebRedisManager " + SAEAVersion.ToString(); var config = SAEAMvcApplicationConfigBuilder.Read(); //config.Port = 16379; //config.IsStaticsCached = false; SAEAMvcApplicationConfigBuilder.Write(config); //启动api SAEAMvcApplication mvcApplication = new SAEAMvcApplication(config); mvcApplication.Start(); //启动websocket WebSocketsHelper webSocketsHelper = new WebSocketsHelper(port: 16666); webSocketsHelper.Start(); ConsoleHelper.WriteLine("SAEA.WebRedisManager Already started"); ConsoleHelper.WriteLine($"Please open on Browser:http://127.0.0.1:{config.Port}/"); ConsoleHelper.WriteLine("Enter to exit service..."); ConsoleHelper.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "WebRedisManager v5.3.2.5"; var config = SAEAMvcApplicationConfigBuilder.Read(); config.Port = 80; config.Count = 100; SAEAMvcApplicationConfigBuilder.Write(config); SAEAMvcApplication mvcApplication = new SAEAMvcApplication(config); mvcApplication.Start(); WebSocketsHelper webSocketsHelper = new WebSocketsHelper(); webSocketsHelper.Start(); ConsoleHelper.WriteLine("WebRedisManager Already started"); ConsoleHelper.WriteLine("Please open on Browser:http://127.0.0.1:80/"); ConsoleHelper.WriteLine("Enter to exit service..."); while (true) { Thread.Sleep(50); } //ConsoleHelper.ReadLine(); }
private static void Main(string[] args) { Console.Title = "GFFServer"; ConsoleHelper.WriteLine("正在初始化消息服务器...", ConsoleColor.Green); messageServer = new MessageServer(count: 100); messageServer.OnAccepted += Server_OnAccepted; messageServer.OnError += Server_OnError; messageServer.OnDisconnected += Server_OnDisconnected; ConsoleHelper.WriteLine("消息服务器初始化完毕...", ConsoleColor.Green); ConsoleHelper.WriteLine("正在启动消息服务器...", ConsoleColor.Green); messageServer.Start(); ConsoleHelper.WriteLine("消息服务器启动完毕...", ConsoleColor.Green); ConsoleHelper.WriteLine("正在初始化文件服务器...", ConsoleColor.DarkYellow); var filePort = ServerConfig.Instance().FilePort; fileServer = new SAEAMvcApplication(port: filePort); fileServer.SetDefault("File", "Test"); ConsoleHelper.WriteLine("文件服务器初始化完毕...", ConsoleColor.DarkYellow); ConsoleHelper.WriteLine("正在启动文件服务器...", ConsoleColor.DarkYellow); fileServer.Start(); ConsoleHelper.WriteLine("文件服务器初始化完毕,http://127.0.0.1:" + filePort + "/...", ConsoleColor.DarkYellow); ConsoleHelper.WriteLine("点击回车,结束服务"); Console.ReadLine(); }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { await Task.Yield(); var config = SAEAMvcApplicationConfigBuilder.Read(); config.Port = 16379; config.IsStaticsCached = false; SAEAMvcApplicationConfigBuilder.Write(config); //启动api SAEAMvcApplication mvcApplication = new SAEAMvcApplication(config); mvcApplication.Start(); //启动websocket WebSocketsHelper webSocketsHelper = new WebSocketsHelper(port: 16666); webSocketsHelper.Start(); try { ConsoleHelper.WriteLine("SAEA.WebRedisManager Already started"); ConsoleHelper.WriteLine($"Please open on Browser:http://127.0.0.1:{config.Port}/"); } catch { } }
static void Main(string[] args) { ConsoleHelper.Title = "WebRedisManager v5.3.2.1"; var config = SAEAMvcApplicationConfigBuilder.Read(); config.Port = 16379; config.Count = 100; SAEAMvcApplicationConfigBuilder.Write(config); SAEAMvcApplication mvcApplication = new SAEAMvcApplication(config); mvcApplication.Start(); WebSocketsHelper webSocketsHelper = new WebSocketsHelper(); webSocketsHelper.Start(); ConsoleHelper.WriteLine("WebRedisManager Already started"); ConsoleHelper.WriteLine("Please open on Browser:http://localhost:16379/"); ConsoleHelper.WriteLine("Enter to exit service..."); ConsoleHelper.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "SAEA.MVCTest"; SAEAMvcApplication mvcApplication = new SAEAMvcApplication(root: "/html/", count: 10000); //设置默认控制器 mvcApplication.SetDefault("home", "index"); mvcApplication.SetDefault("index.html"); //限制 mvcApplication.SetForbiddenAccessList("/content/"); mvcApplication.SetForbiddenAccessList(".jpg"); mvcApplication.Start(); ConsoleHelper.WriteLine("MVC已启动!\t\r\n访问请输入http://127.0.0.1:39654/{controller}/{action}"); ConsoleHelper.WriteLine("回车结束!"); ConsoleHelper.ReadLine(); }
public SAEARESTEDService() { InitializeComponent(); var mvcApplicationConfig = SAEAMvcApplicationConfigBuilder.Read(); _mvcApplication = new SAEAMvcApplication(mvcApplicationConfig); }
public Service1() { InitializeComponent(); mvcConfig = SAEAMvcApplicationConfigBuilder.Read(); mvcApplication = new SAEAMvcApplication(mvcConfig); }
static void Main(string[] args) { ConsoleHelper.Title = "SAEA.MVCTest"; SAEAMvcApplication mvcApplication = new SAEAMvcApplication(); mvcApplication.SetDefault("home", "index"); mvcApplication.Start(); ConsoleHelper.WriteLine("MVC已启动!\t\r\n访问请输入http://127.0.0.1:39654/controller/action"); ConsoleHelper.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "SAEA.MVCTest"; var mvcConfig = SAEAMvcApplicationConfigBuilder.Read(); mvcConfig.Count = 10; mvcConfig.Port = 28080; mvcConfig.IsStaticsCached = false; //mvcConfig.ControllerNameSpace = "SAEA.MVCTest"; SAEAMvcApplicationConfigBuilder.Write(mvcConfig); SAEAMvcApplication mvcApplication = new SAEAMvcApplication(mvcConfig); mvcApplication.OnException += MvcApplication_OnException; //设置默认控制器 //mvcApplication.SetDefault("home", "index"); //mvcApplication.SetDefault("index.html"); //限制 //mvcApplication.SetForbiddenAccessList("/content/"); //mvcApplication.SetForbiddenAccessList(".jpg"); mvcApplication.Start(); mvcApplication.SetCrossDomainHeaders("token", "auth"); mvcApplication.Restart(); ConsoleHelper.WriteLine($"SAEA.MVCApplication 已启动!\t\r\n访问请输入http://127.0.0.1:{mvcConfig.Port}/{{controller}}/{{action}}"); //生成sdk测试 TestCodeGenerate1(); TestCodeGenerate2(); ConsoleHelper.WriteLine("回车结束!"); ConsoleHelper.ReadLine(); }
private static void Main(string[] args) { ConsoleHelper.WriteLine("正在初始化服务器...", ConsoleColor.Green); server = new MessageServer(); server.OnAccepted += Server_OnAccepted; server.OnError += Server_OnError; server.OnDisconnected += Server_OnDisconnected; mvcApplication = new SAEAMvcApplication(port: ServerConfig.Instance().FilePort); ConsoleHelper.WriteLine("服务器初始化完毕...", ConsoleColor.Green); ConsoleHelper.WriteLine("正在启动服务器...", ConsoleColor.Green); server.Start(); mvcApplication.Start(); ConsoleHelper.WriteLine("服务器启动完毕...", ConsoleColor.Green); ConsoleHelper.WriteLine("点击回车,结束服务"); Console.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "WebRedisManager"; SAEAMvcApplication mvcApplication = new SAEAMvcApplication(); mvcApplication.Start(); ConsoleHelper.WriteLine("WebRedisManager已启动"); ConsoleHelper.WriteLine("请在浏览器上打开:http://localhost:39654/"); ConsoleHelper.WriteLine("回车退出服务..."); ConsoleHelper.ReadLine(); }
static void ConsoleStart() { Console.Title = "SAEA.RESTED"; ConsoleHelper.WriteLine("SAEA.RESTED 服务正在启动中..."); SAEAMvcApplicationConfig mvcApplicationConfig = SAEAMvcApplicationConfigBuilder.Read(); SAEAMvcApplication mvcApplication = new SAEAMvcApplication(mvcApplicationConfig); mvcApplication.Start(); ConsoleHelper.WriteLine($"SAEA.RESTED 服务已启动,请在浏览器中输入 \r\n\t\t\t http://localhost:{mvcApplicationConfig.Port}/"); ConsoleHelper.WriteLine("回车结束服务"); Process.Start($"http://localhost:{mvcApplicationConfig.Port}/"); Console.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "WebRedisManager"; var config = SAEAMvcApplicationConfigBuilder.Read(); config.Port = 16379; SAEAMvcApplicationConfigBuilder.Write(config); SAEAMvcApplication mvcApplication = new SAEAMvcApplication(config); mvcApplication.Start(); ConsoleHelper.WriteLine("WebRedisManager已启动"); ConsoleHelper.WriteLine("请在浏览器上打开:http://localhost:16379/"); ConsoleHelper.WriteLine("回车退出服务..."); ConsoleHelper.ReadLine(); }
static void Main(string[] args) { ConsoleHelper.Title = "WebRedisManagerService"; SAEAMvcApplication mvcApplication = new SAEAMvcApplication(false, false, 10240, 1); mvcApplication.Start(); ConsoleHelper.WriteLine("WebRedisManager服务已启动"); ConsoleHelper.WriteLine("服务地址:http://localhost:39654/html/index.html"); try { Process.Start("http://localhost:39654/html/index.html"); } catch { } ConsoleHelper.WriteLine("回车退出服务..."); ConsoleHelper.ReadLine(); }