Solved

vb.net - generate ASCII table

Posted on 2013-02-07
3
469 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data is not showing from images 15 37
Connection String 16 43
Entity Framework 7 31
execute SQL Stored Procedure 1000 times from vb.net 3 22
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

22 Experts available now in Live!

Get 1:1 Help Now