textbox byte

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a method like this

public void MethodName(byte[] data)
{
}

and the textbox.text is the one suppying the argument to the method but my
problem is its a string... how can i do this? any example please? i would
really appreciate any help at all.
 
Well it depends.. will the textbox only be accepting numbers, and thus
creating a list of numbers between 0 and 9 which get translated
directly into your array of bytes on a 1 for 1 basis?

Or ... will the textbox accept any input, and you want to translate the
characters into single bytes?

There is the whole unicode deliberation of course...
 
Hi Rain,

As Steven said, the method will vary depending on what 'data' actually is.
If you just want to get text as byte[], use Encoding.GetBytes, specifying
the encoding you want the bytes in.

It would help if you told us what 'data' is


i have a method like this

public void MethodName(byte[] data)
{
}

and the textbox.text is the one suppying the argument to the method but
my
problem is its a string... how can i do this? any example please? i would
really appreciate any help at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top