Solved

vb.net - generate ASCII table

Posted on 2013-02-07
3
465 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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Rashadhourie earned 500 total points
Comment Utility
      '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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now