Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: NDoc 1.2 Problems Pin
Colin Angus Mackay9-Oct-04 5:49
Colin Angus Mackay9-Oct-04 5:49 
GeneralRe: NDoc 1.2 Problems Pin
Kevin McFarlane9-Oct-04 6:43
Kevin McFarlane9-Oct-04 6:43 
GeneralRe: NDoc 1.2 Problems Pin
Heath Stewart9-Oct-04 7:41
protectorHeath Stewart9-Oct-04 7:41 
Generalhide form from close button Pin
Mridang Agarwalla9-Oct-04 3:40
Mridang Agarwalla9-Oct-04 3:40 
GeneralRe: hide form from close button Pin
Colin Angus Mackay9-Oct-04 3:56
Colin Angus Mackay9-Oct-04 3:56 
GeneralRe: hide form from close button Pin
Colin Angus Mackay16-Oct-04 6:11
Colin Angus Mackay16-Oct-04 6:11 
GeneralRe: hide form from close button Pin
Anonymous17-Oct-04 0:13
Anonymous17-Oct-04 0:13 
GeneralRe: hide form from close button Pin
Colin Angus Mackay17-Oct-04 1:20
Colin Angus Mackay17-Oct-04 1:20 
Generalwav managing Pin
jeroni_brunet9-Oct-04 3:32
jeroni_brunet9-Oct-04 3:32 

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.