Output ASCII Code (C#)
<%@ Page Language="C#" Debug="true" %> <script runat="server"> void Page_Load() { lblASCII.Text += "<Table><TR><TD>Character </TD><TD>ASCII code</TD></TR>"; for (byte bytCounter=33;bytCounter<255; bytCounter++) { lblASCII.Text += "<TR><TD>" + Convert.ToChar(bytCounter) + "</TD><TD>" + Convert.ToString(bytCounter) + "</TD></TR>"; } lblASCII.Text += "</Table>"; } </script> <html> <head> <title>Demonstrate String Comparison</title> </head> <body> <form runat="server"> For your reference, here are the ASCII codes:<br /> <asp:Label id="lblASCII" runat="server"></asp:Label> </form> </body> </html>