title: cannot convert from byte to string (VB.Net to C#)
body: <p>I have a code written in VB.net and translated it to C# (through some site). The code is not complicated so most of the translation turned out fine with no problems what so ever.
  One problem, though, is really causing me a headache and while it is referenced in many websites (including this one), I still can't get it to run.
  I have a function in VB.Net decalred as:</p>
  
  <pre><code>Public Shared Function UTF8HexToByte(ByVal str As String) As Byte
  </code></pre>
  
  <p>and the translator altered it to:</p>
  
  <pre><code>public static byte UTF8HexToByte(string str)
  </code></pre>
  
  <p>Later on, in my C# code, I'm calling this function:</p>
  
  <pre><code>   for (int i = 0; i &lt;= Key1.Length - 1; i++)
              {
                  Key1[i] = 16 * UTF8HexToByte(TempKey1[2 * i]) + UTF8HexToByte(TempKey1[2 * i + 1]);
  
              }
  </code></pre>
  
  <p>but what is working in VB.net does not work here. I'm getting this error:</p>
  
  <p>Error   7   The best overloaded method match for 'maker.Resources.makeC.UTF8HexToByte(string)' has some invalid arguments</p>
  
  <p>Error   8   Argument 1: cannot convert from 'byte' to 'string'</p>
  
  <p>Now, I guess the problem is that <code>UTF8HexToByte</code> is receiving a string and returning a byte, whereas I give it a byte <code>TempKey1</code> and not a string.
  But it does work at the VB.Net code, so I'm confused... here's the code for VB.Net:</p>
  
  <pre><code>For i As Integer = 0 To Key1.Length - 1
          Key1(i) = 16 * UTF8HexToByte(TempKey1(2 * i)) + UTF8HexToByte(TempKey1(2 * i + 1))
      Next
  </code></pre>
  
  <p>TempKey is a byte[], Key1 is a byte[].</p>
  
  <p>Any help will do. I'm really stuck on this one. </p>