[RESOLVED] [02/03] opening a file with cusom application and more
hello
i got a simple Q...
how can i associate a filetype for my appllication, and how have the filename of the file opened with my application? ( like right-click to a file>open with>browse and select my program) or another way?
thanks!
Re: [02/03] opening a file with cusom application and more
Re: [02/03] opening a file with cusom application and more
Once you have setup this association you still have to handle the file in your application. You would do so something like this:
VB Code:
Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length > 1 Then
'A command line argument has been passed to the application.
MessageBox.Show("You have opened the file " & cla(1) & "'.")
End If
Note that you should call File.Exists on the argument because it is possible for the user to pass anything they want on the commandline. You should prepare for even unlikely things because university tests have proven that 7 out of 10 users are morons. ;)
Re: [02/03] opening a file with cusom application and more
Thanks! u saved the day :)
Quote:
Originally Posted by jmcilhinney
because university tests have proven that 7 out of 10 users are morons. ;)
lol
ty again ;)