title: Convert a username to a SID string in C#/.NET
body: <p>There's a question about <a href="https://stackoverflow.com/questions/499053/how-can-i-convert-from-a-sid-to-an-account-name-in-c">converting from a SID to an account name</a>; there isn't one for the other way around.</p>
  
  <p>How do you convert a username to a SID string, for example, to find out which HKEY_USERS subkey relates to a user of a given name?</p>