1

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.

Adam Houldsworth
  • 63,413
  • 11
  • 150
  • 187
user1632018
  • 2,485
  • 10
  • 52
  • 87

4 Answers4

1

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:

  1. open context menu of project (right click project in solution explorer)
  2. go to Publish
  3. Options
  4. 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)

Community
  • 1
  • 1
Pilgerstorfer Franz
  • 8,303
  • 3
  • 41
  • 54
0

You can find the answer here, is about creating file associations for a click once application.

lex87
  • 1,276
  • 1
  • 15
  • 33
0

Try this. Hope it has everything you want. Visit http://www.c-sharpcorner.com/UploadFile/scottlysle/CustomFileType12082006000848AM/CustomFileType.aspx

Roshana
  • 428
  • 3
  • 15
0

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

Alaa Jabre
  • 1,843
  • 5
  • 26
  • 52