Opening Any File
Opening Any File
Opening Any File
Opening Any File
Opening Any File
Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File
Opening Any File Opening Any File
Opening Any File
Go Back  Xtreme Visual Basic Talk > > > Opening Any File


Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2005, 06:30 PM
ai_ess ai_ess is offline
Freshman
 
Join Date: Mar 2004
Posts: 41
Default Opening Any File


Hey everyone,

I know this is suppose to be easy to do, but somehow I can't find any help on how to do it anywhere. I just want to open any file given a file path (e.g. *.exe or *.doc files). Could anyone please help me doing this?

Thank you in advance,
Artur.
Reply With Quote
  #2  
Old 02-12-2005, 07:19 PM
by_m's Avatar
by_m by_m is offline
Contributor
 
Join Date: Jul 2004
Location: Texas
Posts: 661
Default

Actually, I don't think that's necessarily easy. Opening means a different thing for different files. If you want to run .exe files, you can use process.start, to open .Doc files, you'd have to automate microsoft Word. You can't just tell something to "open". If you could say what you're trying to accomplish with that, maybe we could help though.
__________________
170 10101010 410 J31^170
Reply With Quote
  #3  
Old 02-12-2005, 08:52 PM
MikeJ's Avatar
MikeJOpening Any File MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Correct me if I'm wrong, but can't you just do Process.Start(filename)?
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #4  
Old 02-12-2005, 09:18 PM
Evets Evets is offline
Newcomer
 
Join Date: Feb 2005
Posts: 20
Default

Quote:
Originally Posted by MikeJ
Correct me if I'm wrong, but can't you just do Process.Start(filename)?
You are correct. If the file type has an association to an application this will work. You will definitely want to catch the exception in case a file not associated is attempted to be started.
Reply With Quote
  #5  
Old 02-13-2005, 11:41 AM
by_m's Avatar
by_m by_m is offline
Contributor
 
Join Date: Jul 2004
Location: Texas
Posts: 661
Default

Truly so, it was late and I was sick. Wasn't thinking right, sorry about that ai ess. Process.start is that way to go.
__________________
170 10101010 410 J31^170
Reply With Quote
  #6  
Old 02-16-2005, 03:36 PM
ai_ess ai_ess is offline
Freshman
 
Join Date: Mar 2004
Posts: 41
Default

hehe, its alright by_m...thank you guys, this has been very helpful...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Opening Any File
Opening Any File
Opening Any File Opening Any File
Opening Any File
Opening Any File
Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File Opening Any File
Opening Any File
Opening Any File
 
Opening Any File
Opening Any File
 
-->