Reading Groove Registry Keys

You will find in programming with Groove Web Services that you will need registry keys over and over again. The following examples show you calls to make to get these registry keys.

Warning

For security purposes, you should read in these values every time you need them.

If you are using Groove Web Services while running Groove Data Bridge, see Reading Groove Data Bridge Registry Keys.

Getting the Groove Keys from the Registry

The registry keys are stored in a CurrentUser registry hive. The following code reads the registry keys:

// define strings for keys
string requestKey = "";
string responseKey = "";
string httpPort = "";
string groovePID = "";

// Get request key and response key
grooveWebServicesRegKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
  "Software\\Microsoft\\Office\\12.0\\Groove\\WebServices");

if (grooveWebServicesRegKey != null)
{
  Object regValue = grooveWebServicesRegKey.GetValue("LocalRequestKey");
  if (regValue != null) requestKey = regValue.ToString();
  regValue = grooveWebServicesRegKey.GetValue("LocalResponseKey");
  if (regValue != null) responseKey = regValue.ToString();

  Microsoft.Win32.RegistryKey grooveWebServicesHTTPortRegKey =
    Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
    "Software\\Microsoft\\Office\\12.0\\Groove");
    if (grooveWebServicesHTTPortRegKey != null)
    {
      regValue = 
        grooveWebServicesHTTPortRegKey.GetValue("GrooveLocalHTTPPort");

      if (regValue != null) httpPort = regValue.ToString();

      regValue = 
      grooveWebServicesHTTPortRegKey.GetValue("GrooveLocalHTTPServerPID");

      if (regValue != null) groovePID = regValue.ToString();
    }
  }
}
if (requestKey == "")
{
  // Groove is not running, handle error
}

See Also

Reference

Groove Web Services Registry Keys

Concepts

Reading Groove Data Bridge Registry Keys
Security in Groove Web Services