Click here to Skip to main content
15,909,466 members
Home / Discussions / C#
   

C#

 
GeneralPrint with epson LQ300 as a ticket printer Pin
M.D10-Oct-04 1:07
M.D10-Oct-04 1:07 
Generalplease help me in OleDbPermission Pin
tifa10-Oct-04 0:52
tifa10-Oct-04 0:52 
GeneralRe: please help me in OleDbPermission Pin
Heath Stewart10-Oct-04 11:23
protectorHeath Stewart10-Oct-04 11:23 
GeneralRe: please help me in OleDbPermission Pin
tifa10-Oct-04 12:37
tifa10-Oct-04 12:37 
QuestionHow to register? Pin
momer9-Oct-04 23:04
momer9-Oct-04 23:04 
AnswerRe: How to register? Pin
Colin Angus Mackay10-Oct-04 4:01
Colin Angus Mackay10-Oct-04 4:01 
GeneralRe: How to register? Pin
momer10-Oct-04 15:17
momer10-Oct-04 15:17 
AnswerRe: How to register? Pin
Christian Graus10-Oct-04 11:49
protectorChristian Graus10-Oct-04 11:49 
GeneralRe: How to register? Pin
momer10-Oct-04 15:25
momer10-Oct-04 15:25 
AnswerRe: How to register? Pin
Dave Kreskowiak11-Oct-04 6:14
mveDave Kreskowiak11-Oct-04 6:14 
GeneralHelp in editmode on Datalist. Pin
macsgirl9-Oct-04 11:07
macsgirl9-Oct-04 11:07 
GeneralRe: Help in editmode on Datalist. Pin
Heath Stewart10-Oct-04 11:07
protectorHeath Stewart10-Oct-04 11:07 
GeneralWindow Position Pin
dbetting9-Oct-04 10:59
dbetting9-Oct-04 10:59 
GeneralRe: Window Position Pin
Stefan Troschuetz9-Oct-04 22:50
Stefan Troschuetz9-Oct-04 22:50 
GeneralRe: Window Position Pin
dbetting10-Oct-04 3:11
dbetting10-Oct-04 3:11 
GeneralRe: Window Position Pin
Stefan Troschuetz10-Oct-04 7:07
Stefan Troschuetz10-Oct-04 7:07 
GeneralWriting hex values to a file Pin
cgcrute9-Oct-04 6:50
cgcrute9-Oct-04 6:50 
Sorry for the newbie question! I'm trying to write hex values into a file.

I started out using a streamwriter and writing a string:
"\x48\x41\x53\x48\x0D\x0A\xff\x00\x00\x01"

This worked fine, except that when looking at the output file in a hexeditor I got

48 41 53 48 0D 0A C3 BF 00 00 01

Where is should have read FF there was C3 BF!!

The same happens if I create an array and write that using a binary writer, ie:
char[] temp = new char[] {'\x48','\x41','\x53','\x48','\x0D','\x0A','\xFF','\x00','\x02','\x00','\x00','\x00','\x01','\x00','\x00','\x00'};

The only way I can do it is to convert all the hex to decimal and write it that way with a binarywriter:
byte[] temp = new byte[] {72,65,83,72,13,10,255,0,2,0,0,0,1,0,0,0};

But this is a pain, can anyone tell me how I SHOULD be doing this.

Thanks, in advance,

Chris





GeneralRe: Writing hex values to a file Pin
Heath Stewart9-Oct-04 8:01
protectorHeath Stewart9-Oct-04 8:01 
GeneralRe: Writing hex values to a file Pin
cgcrute10-Oct-04 7:46
cgcrute10-Oct-04 7:46 
GeneralRe: Writing hex values to a file Pin
Heath Stewart10-Oct-04 11:05
protectorHeath Stewart10-Oct-04 11:05 
GeneralAdd dropdownlist to datalist Pin
macsgirl9-Oct-04 6:14
macsgirl9-Oct-04 6:14 
GeneralRe: Add dropdownlist to datalist Pin
Heath Stewart9-Oct-04 7:50
protectorHeath Stewart9-Oct-04 7:50 
GeneralRe: Add dropdownlist to datalist Pin
macsgirl9-Oct-04 8:04
macsgirl9-Oct-04 8:04 
GeneralRe: Add dropdownlist to datalist Pin
Heath Stewart9-Oct-04 11:43
protectorHeath Stewart9-Oct-04 11:43 
GeneralNDoc 1.2 Problems Pin
Kevin McFarlane9-Oct-04 5:12
Kevin McFarlane9-Oct-04 5:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.