c# - Open file with association -
i made file editor in c#, , can open files using 'open' button in toolbar, associated correct file types program, when click file extension *.nlp program opens correctly, not open file (which quite logical since did not implement yet)
now question, how implement such thing? want file opened , loaded when click on it.
(btw, file plain text, nothing special, , it's windows if matters)
in windows file associations stored , managed in registry under hkey_classes_root
you can following manually or write little setup program write correct entries registry.
you need register extension , associate program this document describes. see this doc registry should this:
hkey_classes_root .nlp (default) = yourprogid//can want yourprogid shell open command (default) = yourapp.exe %1 now, key answer %1 in command key. filename opened , passed argument app.
so :
static void main(string[] args) { // args contain filename }
Comments
Post a Comment