|
-
May 2nd, 2006, 06:49 AM
#1
Thread Starter
Member
[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!
Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.
-
May 2nd, 2006, 02:38 PM
#2
Junior Member
Re: [02/03] opening a file with cusom application and more
Last edited by stijn.adriaensens; Jun 8th, 2008 at 09:29 AM.
-
May 2nd, 2006, 06:29 PM
#3
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.
-
May 3rd, 2006, 06:45 AM
#4
Thread Starter
Member
Re: [02/03] opening a file with cusom application and more
Thanks! u saved the day 
 Originally Posted by jmcilhinney
because university tests have proven that 7 out of 10 users are morons. 
lol
ty again
Human beings are a disease, a cancer of this planet, you are a plague, and we are the cure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|