Execute() public static method

public static Execute ( string args ) : int
args string
return int
Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("must provide 'server' or 'client' arg");
                return;
            }

            string[] subArgs = new string[args.Length - 1];
            for (int i = 1; i < args.Length; i++)
            {
                subArgs[i - 1] = args[i];
            }
            if (args[0] == "client")
            {
                TestClient.Execute(subArgs);
            }
            else if (args[0] == "server")
            {
                TestServer.Execute(subArgs);
            }
            else
            {
                Console.WriteLine("first argument must be 'server' or 'client'");
            }
        }
Esempio n. 2
0
        static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("must provide 'server' or 'client' arg");
                return(-1);
            }

            try
            {
                Console.SetBufferSize(Console.BufferWidth, 4096);
            }
            catch (Exception)
            {
                Console.WriteLine("Failed to grow scroll-back buffer");
            }

            string[] subArgs = new string[args.Length - 1];
            for (int i = 1; i < args.Length; i++)
            {
                subArgs[i - 1] = args[i];
            }
            if (args[0] == "client")
            {
                return(TestClient.Execute(subArgs));
            }
            else if (args[0] == "server")
            {
                return(TestServer.Execute(subArgs) ? 0 : 1);
            }
            else
            {
                Console.WriteLine("first argument must be 'server' or 'client'");
            }
            return(0);
        }