N
Natan Vivo
Ok, let me explain this first. I did a search about 'hexadecimal'
first and found a lot of threads about it, but none of them tell me
what i want to know.
I am new to C#, and want to work with binary data (actually some
custom file formats). I used to do this a lot in PHP, but i can't
understand how this works in C#.
in PHP i could do this:
$packet = 0x2a . 0x00 . 0x00 . 0x3f . "some string";
it would result in a var with 4 bytes that i specified exacly, and a
string. A simple binary data packet.
in C#, if i try
var = 0x00 + "some string";
when i save this to a file, 0x00 turns to 0x30
all i want is to create a var like i did in the PHP example, but in
the C# way..... anyone can help me?
i don't know if it's the right way to do it in this language, please
if you have a better idea, tell me. =)
first and found a lot of threads about it, but none of them tell me
what i want to know.
I am new to C#, and want to work with binary data (actually some
custom file formats). I used to do this a lot in PHP, but i can't
understand how this works in C#.
in PHP i could do this:
$packet = 0x2a . 0x00 . 0x00 . 0x3f . "some string";
it would result in a var with 4 bytes that i specified exacly, and a
string. A simple binary data packet.
in C#, if i try
var = 0x00 + "some string";
when i save this to a file, 0x00 turns to 0x30
all i want is to create a var like i did in the PHP example, but in
the C# way..... anyone can help me?
i don't know if it's the right way to do it in this language, please
if you have a better idea, tell me. =)