Solved

vb.net - generate ASCII table

Posted on 2013-02-07
3
476 Views
Last Modified: 2013-02-08
hello there,
I am using this code perfectly fine to generate two tables %85 and %86 each contains 127 chars

        For o = 85 To 86
            For i = 0 To 127
                Debug.Print("%" & o & "%" & HttpUtility.UrlEncode(Chr(i), System.Text.Encoding.Default))
            Next
        Next

Open in new window


now that I need to make more tables my code doesn't work. the HEX code goes like this
85
86
87
88
89
8A
8B
8C
8D

reference: http://www.ascii-code.com/
0
Comment
Question by:XK8ER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Rashadhourie earned 500 total points
ID: 38863421
      '85(Hex) = 133 (Decimal)
        For o = 133 To 134
            For i = 0 To 127
                Debug.Print("%" & o.ToString("X") & "%" & Web.HttpUtility.UrlEncode(Chr(i), System.Text.Encoding.Default))
            Next
        Next

Open in new window

Change 134 to the corresponding hex value you want
o.ToString("X")
Converts decimal to hex
0
 
LVL 1

Author Comment

by:XK8ER
ID: 38865345
thats interesting.. I see its generating the hex code but some are on digit.. is it possible to make it always show two digit?
0
 
LVL 1

Expert Comment

by:Rashadhourie
ID: 38867241
for two digits use
ToString("X2") 

Open in new window

this should append 1 or 2 leading zeros to make the number always two digists
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question