Kasutajanimi: Salasõna:
Uue kasutaja registreerimine
Tsensor: toedder 
 Computers

Have computer questions, hints, or tips?

BBW's Tips on how to speed up page load the brainking site
Computers (BIG BAD WOLF, 2007-03-12 20:16:01)



Mida uut on RSS readers kohta?
Vestlusringide loetelu
Režiim: Igaüks võib postitada
Otsi sõnumite hulgas:  

7. juuli 2006, 08:58:07
Hrqls 
Teema: Re: C# serial port sends only 3F above 7F ?
Hrqls toimetatud (7. juuli 2006, 08:58:59)
Hrqls: the encoding classes wont help me .. i need to send 1 byte which has to hold characters from ascii value 0 to ascii value 255 .. the only encoding class which sends only 1 byte is the ascii encoding which sends the 63 (3F) when i try to send a character with ascii value of 128 or higher

but! (yeah! ;)) i can also send the string or character array as a byte array ... which then bypasses the encoding class (or simply doesnt need it)

this works! ;)

so for the loop to send all characters with ascii value from 0 to 255 i now use :

byte[] bytArray;
bytArray = new byte[256];
for (int intI = 0; intI <256; intI++)
{
bytArray[intI] = (byte)intI;
}
comKAR.Write(bytArray, 0, 256);



which works flawlessly

thanks for the help and ideas .. it set me on the right track and made it work :)

Kuupäev ja kellaaeg
Sisselogitud sõbrad
Lemmik-vestlusgrupid
Sõpruskonnad
Päeva vihje
Autoriõigus © 2002 - 2025 Filip Rachunek, kõik õigused kaitstud.
Tagasi algusse