title: Getting wrong serial-port names from bluetoothdevice (c#)
body: <p>To get all avaliable Serialports from the system i use the following command.</p>
  
  <pre><code>SerialPort.GetPortNames
  </code></pre>
  
  <p>It works fine for the mainboard serial port, but with the bluetooth device i get the wrong portnames.</p>
  
  <p>For Example: Instead of COM7 i get sometimes COM70 or COM7ö. Its always 1 letter to much. </p>
  
  <p>any suggestens?</p>
  
  <p>PS: I am using newest Visual Studio Express in Windows 7 
  PPS: The dirty hack to cut the last letter didn't work because i don't know which one is the bluetooth serial port (with various bluetoothstick or devices it changes the number of the comport) and after trying various sticks i reached COM10, ergo COM100 or COM10f</p>
  
  <p>EDIT: the code i am using right now. reading the regestry, but still the same problem.</p>
  
  <pre><code>RegistryKey myRegistry = Registry.LocalMachine.OpenSubKey("Hardware\\DeviceMap\\SerialComm");
  foreach (string valuename in myRegistry.GetValueNames())
  {
      if (myRegistry.GetValue(valuename) is String)
      {
          if (valuename.Contains("BthModem"))
          {
              richTextBox1.AppendText("&gt;" + myRegistry.GetValue(valuename) + "&lt;" + Environment.NewLine);
          }
      }
  } 
  </code></pre>
  
  <p>Normally the second or third request is working with a result like </p>
  
  <blockquote>
    <p>COM11ᯋ&lt;
    COM10S&lt;
    COM11&lt;
    COM10&lt;
    COM11&lt;
    COM10&lt;</p>
  </blockquote>
  
  <p>how can that be? </p>