Opc.Ua.Configuration.ConfigUtils.ProcessCommandLine C# (CSharp) Method

ProcessCommandLine() public static method

Checks if command line arguments specify configuration commands.
public static ProcessCommandLine ( ) : bool
return bool
        public static bool ProcessCommandLine()
        {
            // check if running in command line mode.
            string[] args = Environment.GetCommandLineArgs();

            // need to remove the executable name from the list of args.
            string[] args2 = new string[args.Length-1];
            Array.Copy(args, 1, args2, 0, args2.Length);

            // process the arguments.
            return ConfigUtils.ProcessCommandLine(args2);
        }

Same methods

ConfigUtils::ProcessCommandLine ( string args ) : bool

Usage Example

コード例 #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);
            }
        }
All Usage Examples Of Opc.Ua.Configuration.ConfigUtils::ProcessCommandLine