Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String ^ GetSteamLocation()
- {
- try
- {
- RegistryKey ^ Key = Registry::LocalMachine->OpenSubKey(L"SOFTWARE\Valve\Steam");
- String ^ SteamLocation = Key->GetValue(L"InstallPath")->ToString();
- // I'm not exactly sure if the Close() method will free the resources for you, so I'm calling Dispose() just in case.
- Key->Close();
- Key->Dispose();
- if (String::IsNullOrEmpty(SteamLocation))
- {
- return String::Empty;
- }
- else
- {
- return SteamLocation;
- }
- }
- catch (System::Exception ^ Error)
- {
- return String::Empty;
- }
- }
Add Comment
Please, Sign In to add comment