Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 29th, 2005, 01:36 PM
Authorized User
 
Join Date: Jun 2003
Location: Rio de Janeiro, Rio de Janeiro, Brazil.
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default The RegistryKey class???

How can I get the path of Microsoft Word using the RegistryKey class???

Is there a way to capture the path in a Windows Registry Key???

Thanks.
Reply With Quote
  #2 (permalink)  
Old July 1st, 2005, 04:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Don't know much about Microsoft Word, but I once did this method to retrieve values from the registry...
Code:
private string GetDataValueFromRegistry(string key, string name)
{
    RegistryKey reg = Registry.LocalMachine;
    reg = reg.OpenSubKey(key);
    return (string)reg.GetValue(name);
}
... where the key is like a path, e.g. SOFTWARE\Microsoft etc. Actually, I think you should escape the backslashes.

Hope it helps, Jacob.
Reply With Quote
  #3 (permalink)  
Old July 6th, 2005, 10:40 AM
Authorized User
 
Join Date: Jun 2003
Location: Rio de Janeiro, Rio de Janeiro, Brazil.
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jacob, Tanks for your reply.

To solve the problem i use the code below:

string CaminhoAuxiliar = "";

            RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\Classe s\\"+nomeAplicativo+"\\CLSID");

            CaminhoAuxiliar = (String)rk.GetValue("");

            RegistryKey rk1 = Registry.LocalMachine.OpenSubKey("Software\\Classe s\\CLSID\\"+CaminhoAuxiliar+"\\LocalServer32");

            CaminhoAuxiliar = (String)rk1.GetValue("");

System.Diagnostics.Process.Start(CaminhoAuxiliar);

Thanks....
Thomaz
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using logging class as a static class punitw General .NET 0 August 14th, 2008 03:03 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM
Class disappears in the class panel hint2310 Visual C++ 0 September 18th, 2004 03:46 PM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM



All times are GMT -4. The time now is 02:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.