Active3 years ago
I have developed an application and installed it on a client computer. In my application I need to get its installation path. My application has a registry entry at:
How can I read
AppPath
using C#?Serial Communications. Consider the basic example of enumerating the Software key in the HKEY_CURRENT_USER (HKCU) hive. The following are the basic steps for. Reading serial number from registry office 2013. Microsoft Office. It's not possible to reveal the complete product key, but by following the steps below, we can find the last five digits of the product key associated with your Office on the computer.
DavidRR10.3k1111 gold badges6767 silver badges141141 bronze badges
Magix Music Maker Software For Serial Key
Thorin OakenshieldThorin Oakenshield6,3822828 gold badges9191 silver badges137137 bronze badges
6 Answers
see this http://www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C
Updated:
You can use
RegistryKey
class under Microsoft.Win32
namespace.Some important functions of
mattRegistryKey
are as follows:32622 gold badges99 silver badges2020 bronze badges
Javed AkramJaved Akram9,9072323 gold badges7070 silver badges109109 bronze badges
You're looking for the cunningly named
SLaksSLaksRegistry.GetValue
method.713k145145 gold badges16881688 silver badges18061806 bronze badges
That code should get your value. You'll need to be
for that to work though.
MiguelMiguel7,4521212 gold badges5555 silver badges9595 bronze badges
You can use the following to get where the registry thinks it's installed:
Or you can use the following to find out where the application is actually being launched from:
The latter is more reliable than the former if you're trying to use the
.exe
location as a relative path to find related files. The user could easily move things around after the install and still have the app work fine because .NET apps aren't so dependent upon the registry.Using
StartupPath
, you could even do something clever like have your app update the registry entries at run time instead of crashing miserably due to missing/wrong/corrupted entries.And be sure to look at the app settings functionality as storage for values rather than the registry (
ctype.hProperties.Settings.Default.mySettingEtc
). You can read/write settings for the app and/or the user levels that get saved as simple MyApp.exe.config
files in standard locations. A nice blast from the past (good old Win 3.1/DOS days) to have the application install/delete be a simple copy/delete of a folder structure or two rather than some convoluted, arcane install/uninstall routine that leaves all kinds of garbage in the registry and sprinkled all over the hard drive.1,11044 gold badges1818 silver badges3333 bronze badges
B HB H
If you want it casted to a specific type you can use this method. Most non primitive types won't by default support direct casting so you will have to handle those accordingly.
C0r3yhC0r3yh
Waruna ManjulaWaruna Manjula1,18811 gold badge1313 silver badges2525 bronze badges
Not the answer you're looking for? Browse other questions tagged c#registry or ask your own question.
- Status:Open
- Resolution: Unresolved
- Fix Version/s: None
- Labels:
For Hive to replace a modern datawarehouse based on RDBMS, it must have support for keys, constraints, auto-increment values, surrogate keys and not null features etc. Many customers do not move their EDW to Hive due to these reasons as these have been challenging to maintain in Hive.
This must be implemented once https://issues.apache.org/jira/browse/HIVE-5317 for Updates, Deletes and Inserts are done in Hive. This should be next step for Hive enhancement to take it closer to a very wide mainstream adoption..
HIVE-13061Advance Hadoop Architecture (AHA) - Advance Hive (Umbrella) JIRA -- Enhanced Updates & others
- Open
HIVE-5317Implement insert, update, and delete in Hive with full ACID support
- Closed
![Reading hive for serial keys Reading hive for serial keys](/uploads/1/2/6/5/126535164/818038164.jpg)
HIVE-16575Support for 'UNIQUE' and 'NOT NULL' constraints
- Closed
HIVE-18726Implement DEFAULT constraint
Reading Hive For Serial Keys
- Closed
HIVE-13076Implement FK/PK 'rely novalidate' constraints for better CBO
- Resolved
- Assignee:
- Unassigned
- Reporter:
- Pardeep Kumar
- Votes:
- 26Vote for this issue
- Watchers:
- 34Start watching this issue
- Created:
- Updated: