In my application I have created my own filetype, basically all it is is a normal text file with my own extension on it. Now my question is I want to be able to have my application open up these files on the users computer. So when the user clicks the file they saved from my application it will open up in only my application. I am going to be using clickonce to deploy my application, does it have this functionality in it already? My application is in vb.net.
4 Answers
You may have a look at How to: Create a File Association For a ClickOnce Application. Within the site there is a description how to set it manually. Within VS you may set it by following these steps:
- open context menu of project (right click project in solution explorer)
- go to
Publish
- Options
- File Associations
There you can set all necessary assocs. You should also check out ClickOnce File Association on SO! (Note: access fileName to open by AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData
)

- 1
- 1

- 8,303
- 3
- 41
- 54
Try this. Hope it has everything you want. Visit http://www.c-sharpcorner.com/UploadFile/scottlysle/CustomFileType12082006000848AM/CustomFileType.aspx

- 428
- 3
- 15
your Question consists of tow parts (I guess)
the first is how to create file association and the second is how to open the file when the app runs to answer the first one file association VB.NET
and the second one when you open the file you saved with you're app:
If My.Application.CommandLineArgs < 0 Then
MessageBox.Show("No File dragged into the application's executable!")
Else
Messagebox.Show("File " & My.Application.CommandLineArgs(0) & " is ready to open!")
End If
you can use
My.Application.CommandLineArgs(0)
as file path
best wishes

- 1,843
- 5
- 26
- 52