Jump to content
Tuts 4 You

Help With C#.net


Guest quantumfusion

Recommended Posts

Guest quantumfusion
Posted

what does

Encoding.get_Default().GetBytes(whatever)

do ?

and

BitConverter.GetBytes(num2 + 1)

do ?

and

text1 = Encoding.get_Default().GetString(buffer1, 5, num4);

do ?

thanks

  • 2 weeks later...
Posted
what does

Encoding.get_Default().GetBytes(whatever)

do ?

and

BitConverter.GetBytes(num2 + 1)

do ?

and

text1 = Encoding.get_Default().GetString(buffer1, 5, num4);

do ?

thanks

1.)

puts the bytes of the object provided into an array so like, text.encoding.ascii.GetBytes("Bob")

would make a 3 element array

text.encoding.ascii.GetBytes("Bob"){

array[0] = 66 //B

array[1] = 111 //o

array[2] = 98 //b

}

2.) same thing really.

3.)

text1 = Encoding.ascii.GetString(array);

with an array of

array{

array[0] = 66 //B

array[1] = 111 //o

array[2] = 98 //b

}

would make text1 = "Bob", it takes the array and converts the bytes to ascii(or w/e u choose) then assembles them into a string based on position.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...