title: Convert a string to byte[] for socket
body: <p>I am writing a simple ftp client with c#.<br>
  I am not pro in c#. Is there any way to convert string to byte[] and write it to the socket?<br>
  for example for introducing username this is the socket content:  </p>
  
  <pre><code>5553455220736f726f7573680d0a
  </code></pre>
  
  <p>and ASCII equivalent is:  </p>
  
  <pre><code>USER soroush
  </code></pre>
  
  <p>I want a method to convert string. Something like this:  </p>
  
  <pre><code>public byte[] getByte(string str)
  {
      byte[] ret;
      //some code here
      return ret;
  }
  </code></pre>