Hi,
I have seen a million examples of using command-line parameters in the
following manner:
[STAThread]
static void Main(string[] args)
{
Application.Run(new frmMain(args));
}
public frmMain(string[] args):this()
{
if (args.Length>0)
{
if (args[0].ToUpper().Equals("PUT"))
m_AutomatedFTPMethod = FTPMethods.UploadingFile ;
else if (args[0].ToUpper().Equals("GET"))
m_AutomatedFTPMethod = FTPMethods.DownloadingFile ;
}
}
This actually works fine, but at some point, my form is wiped clean of all
controls and I am left with simply a blank form (plus any code I have
written). Is this structure only meant for Console applications? I've
also looked into the Environment.GetCommandLineArgs method, but I'm afraid
that may return different results based on the OS.
Any ideas?
Thanks,
David