BespokeDynamicDnsUpdater.ConsoleApp.Program.Main C# (CSharp) Method

Main() static private method

static private Main ( string args ) : void
args string
return void
        static void Main(string[] args)
        {
            //Thread.Sleep(10000);

            string firstArg = args.FirstOrDefault();

            if (firstArg != null && firstArg == "-config")
            {
                UpdateConfigSettings(args);
                Console.ReadLine();
            }
            else
            {
                string ipAddress = null;
                bool forceUpdate = false;

                var ipAddressArg = args.SingleOrDefault(a => a.StartsWith("/ipaddress:"));

                if(ipAddressArg != null)
                {
                    ipAddress = ipAddressArg.Substring(11, ipAddressArg.Length - 11);
                }

                if(firstArg == "-force")
                {
                    forceUpdate = true;
                }

                UpdateHostnames(ipAddress, forceUpdate);
            }
        }