-1

I want to know how to convert a byte[] to string. I have variable K an integer array and pwd a byte[] hence the the code bellow is giving me errors?

public void temp()
{
    int[] k = new int[256];
    byte[] pwd;
    int temp = 50;
    k[tmp] = pwd[(tmp % Convert.ToString((string)pwd).Length)];
}
1
  • @user1666620 Indeed it would be good duplicate if OP actually specify what is expected input and output. "Give me right code" is simply not enough to know what actual goal/problem is. Commented Jul 24, 2015 at 15:31

1 Answer 1

1

Presumably if it's in a byte array, it's encoded. If you know what encoding, simply call GetString on the encoding. For example, if it's UTF8 encoded:

Encoding.UTF8.GetString(pwd);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.