Results 1 to 4 of 4

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

  1. #1

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

    Resolved [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.

  2. #2
    Junior Member
    Join Date
    Mar 2006
    Posts
    27

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

    Post deleted
    Last edited by stijn.adriaensens; Jun 8th, 2008 at 09:29 AM.

  3. #3
    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

  4. #4

    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