vb.net - VB : How to start my program and read a file by click the file in 'File Explorer'? -


i know how write , read file. put code open own file. if want open file, can click "file > open" in program. had not problem it.

however want develop program better that. in general program, when click file in file explorer, program start , read file. example click ".avi" video file , default program start , play video.

i try in program. save file program ".mmr" binary file. don't have problem save , can open correctly click "file > open" in program. set program @ default open ".mmr" in file explorer. when double click ".mmr" file in file explorer, program starts, nothing happens after that. know didn't put code read file when program starts.

this source code.

public strfilelocation string 'file location  private sub frmmain_load(byval sender system.object, byval e system.eventargs) handles mybase.load  end sub  private sub subopen()  'there code read '.mmr' file.  'i didn't use parameter. use variable file location because program complex use parameter it. 'strfilelocation should open file location.  end sub 

how make program knows starts open file (read file after program starts) or without open file (nothing do)?

how strfilelocation gets open file location (the file click in file explorer)?

you may find in command lines. can access command lines system.environment.getcommandlineargs


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -