Pages: [1]
  Print  
Author Topic: How to open any file from VB.net  (Read 1156 times)
mark
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: November 07, 2008, 03:04:51 PM »

hey guys i want to open any file from its associated Program.
eg: if its .html default web browser should open than file. how can i do this?
Logged

kent
Full Member
***
Offline Offline

Posts: 117



View Profile
« Reply #1 on: November 08, 2008, 01:27:22 AM »

first you need to import System.Diagnostics.Process
Code:
Imports System.Diagnostics.Process

Then within a function use this code
Code:
  Try
            'give a file path as a string to Start method.
            Start("filename.html")
           
  Catch
            'use any code here if file can not be opened.
  End Try
Logged


Pages: [1]
  Print  
 
Jump to: