so I'm trying to get my notepad program that I just created to open whichever file was double-clicked. I changed the default program in windows to the exe of my new program, but it only opens the program itself and not the file in it. I'm assuming I need to a statement when loading the program to "File.WriteAllText" to the box1.Text, no?
But I don't know how to call the file path of the file that was doubleclicked outside of the program. I'm assuming I need something like this:
public Form1()
{
InitializeComponent();
//string filename;
//filename = file path that was double clicked
if (filename == null)
//open program.....
if (filename > 0)
//
File.WriteAllText(filename.FileName, box1.Text);
}
something to that effect?

New Topic/Question
Reply



MultiQuote





|