vb.net - generate ASCII table

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/
LVL 1
XK8ERAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RashadhourieConnect With a Mentor Commented:
      '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
 
XK8ERAuthor Commented:
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
 
RashadhourieCommented:
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
All Courses

From novice to tech pro — start learning today.