title: Reading the registry with set and get properties
body: <p>I am not sure what i am doing wrong here.  I have a class created to get some reg key values and I keep on getting type cast errors.  I pass in the name of the key.  The value of the key is a int.  Which should  also be the return value.  </p>
  
  <p>I keep on getting this error </p>
  
  <blockquote>
    <p>Cannot Implicitly convert type 'string' to int </p>
  </blockquote>
  
  <p>in the following locations: </p>
  
  <pre><code>rValue = (string)myKey.GetValue("DebugLog");
  &amp;set { DebugLog = getDebugLog(value);}
  </code></pre>
  
  <p>note this in in c#</p>
  
  <pre><code>private int DebugLog;
  
  private int getDebugLog(String name)
  {
      int rValue;
      myKey = Registry.LocalMachine.OpenSubKey(regKey + name, false);
      rValue = (string)myKey.GetValue("DebugLog");
      return rValue;
  }
  
  public int debugLog
  {
      get { return DebugLog; }
      set { DebugLog = getDebugLog(value);}
  }
  </code></pre>