Hi All,

So I'm working on a project that involves saving and opening of binary files. I've got both the save and open methods working properly - using SaveFileDialog and OpenFileDialog respectively. So when I explicitly call these methods to save or open a file, they work as they should and I can save the data or load the data into my program.

The problem I'm running into is occurring when I save a file, close the application, then double-click the saved file to open it. It will open the application, but I can't figure out how to work with the binary file. I've tried to use the Environment.GetCommandLineArgs() thinking I could then get the filename and send it to my load method - put when I cycle through all the command line arguments, I only get one string (the name of the application).

I've done a lot of searching online, and it may just be that I'm not searching for the proper thing, but any help that anyone could provide on this would be extremely appreciated.

Thanks!

What do you mean by working with a binary file?

Well my form has multiple input fields, and when I call the save method, I combine all those fields into an object and then serialize that object into a binary file. Did I just dance around your question - or did I get what you were asking?

I don't think I can answer your question so right on the fly, but you certainly made it much clearer for the guys and girls around here.:)

Well nonetheless, thanks for alerting me to the fact that my initial post was a tad confusing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.