Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET File I/O and Registry > File Types and System Registry...


Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2006, 02:07 PM
GForce GForce is offline
Freshman
 
Join Date: Mar 2006
Location: Pittsburgh, PA
Posts: 44
Default File Types and System Registry...


Can anyone give, or point me to, a tutorial on how the system registry works with File Types? The information exists within the System Registry to know which File Extensions are related to which application(s) and the corresponding Launch String for an application to use a file.

For example .XLS Files are typically opened with Microsoft Excel. Somewhere in the system registry is a key that instructs the OS to open the necessary application. It might look something like the following: "C:\Program Files\Microsoft Office\Excel.exe %1". Where %1 is the old DOS reference to the parameter, which in this case would be the .XLS FilePath and Name.

My application is storing and retrieving attachments from an SQL Server DB, and I want to be able to determine whether the client PC can open an attachment by using the system registry.

Last edited by GForce; 11-13-2006 at 02:08 PM. Reason: Fix typo
Reply With Quote
  #2  
Old 11-13-2006, 02:43 PM
Aquila's Avatar
Aquila Aquila is offline
Contributor
 
Join Date: Oct 2002
Location: Ocala, Fl.
Posts: 597
Default

You could look in HKEY_ClASSES_ROOT and see if your particular extension has an OpenWithList with something in it. (No openwithlist or nothing inside it then they can't open it)
__________________
Plotting to take over the world since 1978
Reply With Quote
  #3  
Old 11-14-2006, 08:43 AM
GForce GForce is offline
Freshman
 
Join Date: Mar 2006
Location: Pittsburgh, PA
Posts: 44
Default OK, but...

That relies on the application being within the System Path. I would rather use the registry in the manner the OS does and launch the application uisng the string provided in the key. This way if there are necessary switches (command line arguments) for a file type they are included.
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
 
 
-->