?
Solved

vb.net - generate ASCII table

Posted on 2013-02-07
3
Medium Priority
?
477 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

777 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