Home > Startup, WPF > retrieving command-line args for WPF application

retrieving command-line args for WPF application

Normally in winform applications, command line arguments are accessed from the string array argument in the main method. However in WPF main method is auto generated and can not be acceEditssed directly. So how to access the command line args with WPF application.

The answer is use “System.Environment.GetCommandLineArgs”. Calling this method returns command line arguments at any given point of time.

Advertisements
Categories: Startup, WPF
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: