title: Opening custom file type in application?
body: <p>In my application users create text based files and then they are saved into my own special filetype. When I create my clickonce project I am going to set it up so that my application opens these files when they are clicked open outside of the application. </p>
  
  <p>My question is, how exactly do I write the logic so my program knows that it is opening through a file, so I can load the file into my application?  I am geussing there is some kind of code I need to put in the form load to choose how the app is going to load, whether it opens a file or it loads as it normally would If I just opened it's assembly. I am just not sure how I do that. I am using vb.net.</p>
  
  <p>Would this work? How can I test this before I create my clickone program and set the filetype associations?</p>
  
  <pre><code>If (Environment.GetCommandLineArgs.Length &gt; 1) Then
  
      Dim s As String = Environment.GetCommandLineArgs(1)
  
      ' Open file s
  
  End If
  </code></pre>