Results 1 to 4 of 4

Thread: [RESOLVED] [02/03] opening a file with cusom application and more

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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:
    1. Dim cla As String() = Environment.GetCommandLineArgs()
    2.  
    3.         If cla.Length > 1 Then
    4.             'A command line argument has been passed to the application.
    5.             MessageBox.Show("You have opened the file " & cla(1) & "'.")
    6.         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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2

    Thread Starter
    Member frix199's Avatar
    Join Date
    Dec 2005
    Location
    Thessaloniki, Greece iamthebest: True
    Posts
    59

    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


    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
  •  



Click Here to Expand Forum to Full Width