Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
Opening an existing file on my PC (Thursday, December 23, 2004)
 

Found the following interesting discussion in the Newsgroups:

Opening an existing file on my PC
by:LB

I have one form that has two buttons. I want the first button to exit the
form, and the second button to open a specific file on my C: drive.

I can get the form to close (Woo!), but can anybody tell me the code needed
to open an existing file on my computer. I've spent all morning looking on
the net but have had no luck.

The file, if it makes any difference, is a .pps

Thanks in advance people.

Luke



 Reply:
by:Cor Ligthert

 Hi Luke,

Can you try this one

\\Dim p As New System.Diagnostics.ProcessStartInfo()
p.FileName = "C:\filename.pps"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

Cor


 Reply:
by:Hal Rosser

 Try using the System.IO.StreamReader class
dim sr as System.IO.Streamreader
sr = new System.IO.StreamReader("theFileName.pps")

assuming you want to read the file
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004



Posted by Xander Zelders



 
Previous Posts
    - Convert charref ({) to normal letters
    - Using projects
    - Help with Datagrid events please.
    - Quotes within a text string
    - Quotes within a text string
    - Set the default "initial" value of a ComboBox
    - Re: Restrict keys in textbox w/o KeyAscii?
    - Returning values FROM window form
    - Make multithreading do only X threads at a time.
    - Is it possible to execute an iSeries program from ...

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland