Guest Kallisti Posted December 10, 2003 Report Posted December 10, 2003 Right, the Command object doesn't work (it's there, just throws an exception if you try and use it in the compact framework), and Environment doesn't have any command line variables in it that I can find. So how do I get at the command line arguments that I've included in the shortcut to my app?
Guest Peter Foot Posted December 15, 2003 Report Posted December 15, 2003 Use an overload of your sub Main which accepts an array of strings - which will receive your application arguments e.g. public class Form1 : System.Windows.Forms.Form { static void Main(string[] args) { Application.Run(new Form1(args)); } public Form1(string[] args) { InitializeComponent(); //setup your form stuff here and populate controls, fields etc using arguments as required } //other methods properties etc }
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now