Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
        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();
        }
Пример #5
0
        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 { }
        }
Пример #6
0
        public SAEARESTEDService()
        {
            InitializeComponent();

            var mvcApplicationConfig = SAEAMvcApplicationConfigBuilder.Read();

            _mvcApplication = new SAEAMvcApplication(mvcApplicationConfig);
        }
Пример #7
0
        public Service1()
        {
            InitializeComponent();

            mvcConfig = SAEAMvcApplicationConfigBuilder.Read();

            mvcApplication = new SAEAMvcApplication(mvcConfig);
        }
Пример #8
0
        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();
        }
Пример #9
0
        static void Main(string[] args)
        {
            ConsoleHelper.Title = "WebRedisManager";

            SAEAMvcApplication mvcApplication = new SAEAMvcApplication(root: SAEAMvcApplicationConfigBuilder.Read().Root);

            mvcApplication.Start();

            ConsoleHelper.WriteLine("WebRedisManager已启动");

            ConsoleHelper.WriteLine("请在浏览器上打开:http://localhost:39654/");

            ConsoleHelper.WriteLine("回车退出服务...");

            ConsoleHelper.ReadLine();
        }
Пример #10
0
        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();
        }
Пример #11
0
        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();
        }