Results 1 to 3 of 3

Thread: select and open files in vb.net

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Location
    Kl, Malaysia
    Posts
    8

    Unhappy select and open files in vb.net

    Hi all,
    need your help.
    in vb.net, how am i going to browse a file and open/execute the selected file (no matter what the file format is, either it was a EXE, doc or picture file.)
    thank you very much.
    chowboon

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    VB Code:
    1. Dim p As New Process(), s As String
    2. Try
    3.     s = "C:\myfile.pdf"
    4.     p.Start(s)
    5. Catch ex As System.Exception
    6.     MessageBox.Show(ex.Message)
    7. End Try

    In the above code 'S' is the path to your file, you can assign this path various ways, one may be showing a fileopendialog and let the user choose the file.
    Last edited by Lunatic3; Jun 13th, 2003 at 03:40 AM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2003
    Location
    Kl, Malaysia
    Posts
    8
    haha got it, thank you very much guy
    chowboon

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