|
Hi all,
How to convert hex value to extended ascii code and the output should be show in richtextbox.Pls help me.Thank you 2 all..
|
|
|
|
|
Hi,
int.ToString("X8"); is what I use normally.
Not sure why you mention extended ASCII, it's only digits and letters after all.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Well, you pretty much want hex -> int -> ascii right?
Well, you can use Convert.ToInt32, like this:
string hex = "0x0F";
int num = 0;
num = Convert.ToInt32(hex, 16);
The first parameter is the string containing the number, and the second is the base. ie Hex is base 16 and normal int's are base 10. Binary is base 2.
So, now that you have a number cast it as a char, that should give you your ascii character. If you want to build a string, then set up an array of bytes, and fill it with the results from your Convert.ToInt32; you can then get a string from the array by using Encoding.ASCII.GetString(arrayOfBytes);
And, of course, these could have been easily found out by typing something like "c# hex to ascii" or "c# hex to int" something like that.
EDIT: Oh, and you can figure out how to get it into the rich text box yourself right? Good.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Or do you mean you have the value of a Unicode character in a string as hexadecimal and want to display the character?
|
|
|
|
|
No.Actually i want display ascii character in richtextbox.As a example,in richtextbox i wanna draw rectangle using this ascii char.So i need convert hexadecimal num to ascii char..
|
|
|
|
|
Oh, the line drawing characters? OK, I just tried it and found that Ariel won't do it, but I changed my RichTextBox to use Courier New and it works. So it's a matter of the typeface in use.
|
|
|
|
|
This is what you are asking for:
string hex = "B8";<br />
int code = Convert.ToInt32(hex, 16);<br />
SomeRichTextBox.Text = Encoding.Default.GetString(new byte[] { (byte)code } );
This will convert a string containing the hexadecimal representation of a number into a number, then it will use the current ANSI encoding of the system to turn that number into a character.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
Where can i find some tutorial on the subject of getting info on the hardware of my machine and how to change the settings.
Thanks
|
|
|
|
|
wrong place....
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Are you saying he will find the info at the wrong place
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
no i said its wrong place to ask that question... that 2 words make sense to understand what i have said
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
the original question was: "Where can i find some ..."
and you replied: "wrong place"
so I guess you meant to say: "at the right place which isn't here"
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I want to call a form from an outlook addin....is it possible? if not what can I use as a custom ui in this application?
|
|
|
|
|
Have found the answer....yes
|
|
|
|
|
How to change the color of the title/header bar in c# windows forms applications?
Thanks!!!
|
|
|
|
|
That would be user-hostile; don't do it.
|
|
|
|
|
i know lots of valid reasons to do that...
|
|
|
|
|
I can't think of any; list some.
|
|
|
|
|
Hi,
I am very new to C# development and I am using VS2005
I want to write small module for my company that send XML data to a gateway (Asp page) and get the response in XML format
I have to send the data (requesting) in XML format to a web site and need to get the response for the request
First I tried with Webclient (System.Net.WebClient) with following codes
[C#]
Client.UploadFile("http://sample_site/upload.aspx", @"C://Regsitering_Data.xml");
Client.DownloadFile("http://sample_site/downloaddata.aspx","C:\\Responses.asp")
[/C#]
However, this way I managed to post the data. I checked with the gateway people and they confirmed that my request is correct and the webservice has sent the response correctly. However I am not able to get the response from there. I am getting Error as results
I know that I am doing wrong. I tried with HttpWebRequest and HttpWebResponse, but I dont know how to post XML data into the with using
HttpWebRequest
Please help me on this.
|
|
|
|
|
And what error are you getting?
If you don't provide sufficient information relating to your problem, no one will be able to help you.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks
I am not getting any error from .Net framework. I am getting the error message from their gateway. Message is "you sent a empty message body to gateway". This is the error that we use to receive when we just typed the response URL in internet explorer/Fire3fox
I checked with them and they said that my request reached successfully and the gateway sent the Unique message Id as a response in XML format. But I am not getting this response
I am feeling that downloaddata method is not for getting response for a request. However I am not sure on this. This is the first time I am trying to send a data to a web site (Webservice)
I searched in google and all are recommending to use webrequest and webresponse methods, but I dont know how to use these methoids when I want to send data in XML format
Please help me. Please let me know you need more information and my code for this---
|
|
|
|
|
|
I am building a Web Browser on C#.Net.
How do i include a Google search web service on my web browser?
|
|
|
|
|
Any way you like; as long as you're reinventing that wheel you may as well start fresh.
|
|
|
|
|
I didnt get the answer to my Query.....!
|
|
|
|