Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2005, 01:36 PM
Authorized User
 
Join Date: Jun 2003
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.
 
Old July 1st, 2005, 04:34 PM
Friend of Wrox
 
Join Date: Jun 2003
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.
 
Old July 6th, 2005, 10:40 AM
Authorized User
 
Join Date: Jun 2003
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.