Very recently I get some request about ASCII code generate.
So that I share with this code...using System;
using System.Web.UI;
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<table><tbody<tr>
<td>Decimal</td><td>ASCII character
</td><td>Hexadecimal</td></tr>\n");
int min = 0;
int max = 128;
for (int i = min; i <>// Get ascii character.
char c = (char)i;
// Get display string
string display = string.Empty;
if (char.IsWhiteSpace(c))
{
display = c.ToString();
switch (c)
{
case '\t':
display = "\\t";
break;
case ' ':
display = "space";
break;
case '\n':
display = "\\n";
break;
case '\r':
display = "\\r";
break;
case '\v':
display = "\\v";
break;
case '\f':
display = "\\f";
break;
}
}
else if (char.IsControl(c))
{
display = "control";
}
else
{
display = c.ToString();
}
// Write table row
Response.Write(string.Format("<tr><td>{0}</td>
<td>{1}</td><td>{0:X2}</td>
</tr>\n", i, display));
}
Response.Write("</tbody></table>");
}
}
Sharing real-world experiences about C#, Dynamics CRM, Dynamics 365, Dynamics NAV/Business Central, SharePoint,PowerBI,ASP.net and more...
Showing posts with label ascii. Show all posts
Showing posts with label ascii. Show all posts
Wednesday, January 12, 2011
How to generate ASCII Table
Subscribe to:
Posts (Atom)
Method 'StartWorkflowOnListItem' in type 'Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider'
Exception: Method 'StartWorkflowOnListItem' in type 'Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider'...
-
It is very common questions for new web developer how to get the client's country location to track the user.In various forum I have f...
-
There are various ways to use Single Sign on(SSO) in asp.net web application. We can use cookies, session (state server), SAML and web serv...
-
Today I have added Google Map my asp.net application successfully !! Don't worry it's not a big deal. Very easy and you will find a ...