Tag Archives: command line arguments

Use command line arguments to open files in C#

Whenever a C# program starts, it receives command line arguments. You can use those arguments to let your program open files that are associated with the program. For example, when you double-click a .doc or .docx file, Microsoft Word opens … Continue reading

Posted in serialization, system | Tagged , , , , , , , | Leave a comment

Get command line arguments in C#

One method to do this is to override the program’s Main method and give it a parameter that is a string array as in the following code. static void Main(string[] args) { foreach (string arg in args) { lstArguments.Items.Add(arg); } … Continue reading

Posted in system | Tagged , , , , , , , , , | 1 Comment