473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to get a ASCII value for a set of text?

Hi ! im working with asp.net(vb)
I need to get the ASCII value for a set of text which is typed in a text box.
I use a text box and a button, clicking on the button should show the equivalent ascii value for the text which is typed in the text box.
How do i achieve this?

Please provide a valid solution. Thanks in advance.
Jan 22 '08 #1
2 1170
Plater
7,872 Expert 4TB
You are referering to the decimal value for the individual characters in a string right?
Expand|Select|Wrap|Line Numbers
  1. char c= 'A';
  2. int asciivalue=(int)c;
  3. //now asciivalue is = to 65
  4.  
Then remember you can do something like this:
Expand|Select|Wrap|Line Numbers
  1. string mystr="Fred runs fast.";
  2. for(int i=0;i<mystr.Length;i++)
  3. {
  4.    char c=mystr[i];
  5.    int asciivalue=(int)c;
  6.    //now do something with the ascii value
  7. }
  8.  
Jan 22 '08 #2
Use the the
Expand|Select|Wrap|Line Numbers
  1. System.Convert.ToInt16
  2.  
method
Jan 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
1
by: Kermit Piper | last post by:
Hello, I have a function that lets me convert one character and throw an alert with the corresponding ASCII value, but what I am having trouble with is applying it to a text box. What I'm trying...
1
by: Kermit Piper | last post by:
Hello, OK, almost there. Here's what I have so far, which handles characters as they're typed in. Could someone please show me how I would loop through all the values that are entered if a block...
13
by: greg | last post by:
Hello, I'm searching to know if a local file is ascii or binary. I couldn't find it in the manual, is there a way to know that ? thanks, -- greg
9
by: pamelafluente | last post by:
I have found on the web a post with this useful way to convert (if possible) a ScanCode to Ascii. This is remarkably useful to filter keys under KeyDown/up event. My problem is that I am not...
7
by: Jeffrey Spoon | last post by:
Hello, I'm a bit stuck trying to convert a text file which contains extended ASCII text and changing the ASCII values so they become readable. I do this by subtracting 127 from the ASCII value....
8
by: ianenis.tiryaki | last post by:
i couldnt figure out how i am supposed to find the ASCII code is there any way to do it? and main problem is i am not sure so i wanted to ask is it going to display 'a' ? am i right? What is...
4
by: meendar | last post by:
Hi, I am having a character pointer which contains ascii values. i just want to convert all these ascii values to respective characters and again store it in another character pointer. ...
9
by: =?Utf-8?B?UGhhbmlkaGFy?= | last post by:
Hi, I'm developing a Winform application in C#( .net 2.0). I've a dialog box where user can input text and that text would be sent across to other machine using sockets. When the user enters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.