To put it quite simply, I’ve been working on a text encryptor that deals with opening and saving encrypted files. However, when I click the encrypted file outside of the program, it of course opens my program and passes a path to Main(string[] args). However, I have no clue how to get the path name from the array(So I can’t auto open the file when my program starts). Currently my program is called, opened, and displays an empty text box, just like when its opened under regular circumstances.
Edit: This has been resolved using
string path = args[0];
The
argsparameter is just a string array, as indicated.The first parameter passed will be
args[0], the second will beargs[1], and so on.In this case, assuming the path is the only parameter passed you would use