示例#1
0
        private void button11_Click(object sender, EventArgs e)
        {
            FHttpService fp = new FHttpService();

            fp.Show();
        }
示例#2
0
        static void Main(string[] args)
        {
            //if (Environment.OSVersion.Version.Major >= 6)
            //    SetProcessDPIAware();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            object[] os = CalculatePi(100);
            //MessageBox.Show($"PI = {os[0]}{Environment.NewLine}Time = {os[1]}ms");
            //return;
            //MessageBox.Show("Custom MessageBox Demo...", Application.ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (args == null || args.Length == 0)
            {
                MainEntry main = new MainEntry(0);
                Application.Run(main);
            }
            else
            {
                Form f = null;
                switch (args[0].ToLower())
                {
                case "-as":
                    if (args.Length >= 3)
                    {
                        f = new FAsyncServer(args[1], int.Parse(args[2]));
                    }
                    else
                    {
                        f = new FAsyncServer();
                    }
                    break;

                case "-tab":
                    int idx = 0;
                    if (args.Length >= 2 && int.TryParse(args[1], out idx))
                    {
                        f = new MainEntry(idx);
                    }
                    break;

                case "-ssl":
                    Application.Run(new MyApplicationContext(new FSslTcpServer(), new FSslTcpClient()));
                    return;

                case "-http":
                    f = new FHttpService();
                    break;

                case "-routing":
                    f = new FRoutingTable();
                    break;

                case "-skt":
                    f = new FSocketMonitor();
                    break;

                default:
                    break;
                }
                if (f != null)
                {
                    Application.Run(f);
                }
                else
                {
                    Application.Run(new MainEntry(0));
                }
            }
        }