Associating File Types - Continued

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Jason, could you please explain to me what else I have to do?


Your filename will be passed as the first argument on the command line.
Check it with something like this:

static void Main(string[] args)
{
if (args.Length == 1 && System.IO.File.Exists(args[0]))
{
Application.Run(new MainWindow(args[0]));
}
else
{
Application.Run(new MainWindow(null));
}
}

......and you can handle loading the file in your application class
constructor.

-Jason
 
Well Bill, I had to leave something for you to do yourself. Add a
constructor to your form that takes a string argument, open the file
that was passed in and figure out how to get the contents of the file
into your control. I'm too busy right now to work up a more detailed
example. I'm sure others will jump in if you have more specific questions.

-Jason
 
\ || Add a
|| constructor to your form that takes a string argument
/

I have no clue what that means. Could someone please help me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top