ProcessCommandLine() public static method

Checks if command line arguments specify configuration commands.
public static ProcessCommandLine ( ) : bool
return bool
コード例 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // check if running in command line mode.
            string[] args = Environment.GetCommandLineArgs();

            try
            {
                if (args.Length > 1)
                {
                    if (ConfigUtils.ProcessCommandLine())
                    {
                        return;
                    }
                }

                ApplicationConfiguration configuration = GuiUtils.DoStartupChecks(
                    "Opc.Ua.ConfigurationTool",
                    ApplicationType.Client,
                    "Opc.Ua.ConfigurationTool.Config.xml",
                    false);

                if (configuration != null)
                {
                    Application.Run(new MainForm(configuration));
                }
            }
            catch (Exception e)
            {
                GuiUtils.HandleException(Utils.Format(
                                             "UA Certificate Tool: {0} {1}",
                                             (args.Length > 1)?args[1]:null,
                                             (args.Length > 2)?args[2]:null),
                                         null,
                                         e);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mcooper87/UA-.NET
        static void Main(string[] args)
        {
            try
            {
                // check the arguments
                if (args.Length < 2)
                {
                    Console.WriteLine("Not enough command line arguments provided.");
                    return;
                }

                // process command line.
                ConfigUtils.ProcessCommandLine(args);
            }
            catch (Exception e)
            {
                Console.WriteLine("Unexpected error: {0}", e.Message);
            }
            finally
            {
                // Console.ReadLine();
            }
        }