Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# string formatting Pin
OriginalGriff15-Feb-14 23:06
mveOriginalGriff15-Feb-14 23:06 
AnswerRe: C# string formatting Pin
V.16-Feb-14 21:05
professionalV.16-Feb-14 21:05 
QuestionClick Event On DataGridview Cell Pin
Soahib jamil15-Feb-14 1:36
Soahib jamil15-Feb-14 1:36 
AnswerRe: Click Event On DataGridview Cell Pin
Richard MacCutchan15-Feb-14 1:41
mveRichard MacCutchan15-Feb-14 1:41 
AnswerRe: Click Event On DataGridview Cell Pin
Peter Leow15-Feb-14 1:50
professionalPeter Leow15-Feb-14 1:50 
QuestionHow to deserialize the hexadecimal value ? Pin
rkarthickbeece14-Feb-14 19:26
rkarthickbeece14-Feb-14 19:26 
AnswerRe: How to deserialize the hexadecimal value ? Pin
Richard Andrew x6414-Feb-14 19:34
professionalRichard Andrew x6414-Feb-14 19:34 
AnswerRe: How to deserialize the hexadecimal value ? Pin
BillWoodruff14-Feb-14 22:27
professionalBillWoodruff14-Feb-14 22:27 
What's in your file that you serialize is not a representation of a hexadecimal value: it's the character-code "3," which is turned into a glyph when you see it on screen that looks like a super-scripted tiny "L." The CodeProject editor here will not display that character-code.

The writing process, whether you use StreamWriter or XmlWriter, cannot know your intent from such "raw" use of character codes outside the usual range.

The solution is to express your intent that the content is hexadecimal by using an Xml "legal" data format like
1#x3;: a
2#x3;: s
3#x3;: d
4#x3;: f
5#x3;: g
Which will serialize (if you use an XmlWriter) to:
<?xml version="1.0" encoding="utf-8"?><TestClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><No>25</No><Name>TestUser</Name><Address>No 4,East St</Address><AsciiCharactors> 1#x3;: a
 2#x3;: s
 3#x3;: d
 4#x3;: f
 5#x3;: g</AsciiCharactors></TestClass>
The legal formats for Xml are provided in this document: [^]. Note the following:
"If the character reference begins with " &#x ", the digits and letters up to the terminating ; provide a hexadecimal representation of the character's code point in ISO/IEC 10646. If it begins just with " &# ", the digits up to the terminating ; provide a decimal representation of the character's code point."
If you used the format " &#x??; ":

... not able to display that format correctly using CodeProject's editor ...

You would get this as output (using XmlWriter):
<TestClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><No>25</No><Name>TestUser</Name><Address>No 4,East St</Address><AsciiCharactors> 1&#x3;: a
 2&#x3;: s
 3&#x3;: d
 4&#x3;: f
 5&#x3;: g</AsciiCharactors></TestClass>

“But I don't want to go among mad people,” Alice remarked.

“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”

“How do you know I'm mad?” said Alice.

“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll


modified 15-Feb-14 5:39am.

AnswerRe: How to deserialize the hexadecimal value ? Pin
PIEBALDconsult15-Feb-14 3:29
mvePIEBALDconsult15-Feb-14 3:29 
QuestionC and C# similarities!!! Need Help....Beginner!!! Pin
Member 1058315014-Feb-14 12:09
Member 1058315014-Feb-14 12:09 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
PIEBALDconsult14-Feb-14 13:02
mvePIEBALDconsult14-Feb-14 13:02 
GeneralRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Member 1058315014-Feb-14 13:31
Member 1058315014-Feb-14 13:31 
GeneralRe: C and C# similarities!!! Need Help....Beginner!!! Pin
OriginalGriff14-Feb-14 22:50
mveOriginalGriff14-Feb-14 22:50 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Peter Leow14-Feb-14 18:23
professionalPeter Leow14-Feb-14 18:23 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Richard Andrew x6414-Feb-14 19:31
professionalRichard Andrew x6414-Feb-14 19:31 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Richard MacCutchan14-Feb-14 22:46
mveRichard MacCutchan14-Feb-14 22:46 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
OriginalGriff14-Feb-14 22:56
mveOriginalGriff14-Feb-14 22:56 
QuestionCant Open SQL connection Pin
mcgurdan14-Feb-14 5:51
mcgurdan14-Feb-14 5:51 
AnswerRe: Cant Open SQL connection Pin
Ravi Bhavnani14-Feb-14 6:17
professionalRavi Bhavnani14-Feb-14 6:17 
AnswerRe: Cant Open SQL connection Pin
OriginalGriff14-Feb-14 8:45
mveOriginalGriff14-Feb-14 8:45 
AnswerRe: Cant Open SQL connection Pin
jschell14-Feb-14 10:25
jschell14-Feb-14 10:25 
QuestionHow to create a moving text up in C# 2005 ? Pin
Member 245846714-Feb-14 3:37
Member 245846714-Feb-14 3:37 
QuestionRe: How to create a moving text up in C# 2005 ? Pin
thatraja14-Feb-14 4:10
professionalthatraja14-Feb-14 4:10 
QuestionC# Path Finding Recommendations Pin
Phil_9314-Feb-14 2:57
Phil_9314-Feb-14 2:57 
AnswerRe: C# Path Finding Recommendations Pin
thatraja14-Feb-14 4:03
professionalthatraja14-Feb-14 4:03 

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.