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...
Wednesday, January 12, 2011
How to generate ASCII Table
Subscribe to:
Post Comments (Atom)
Method 'StartWorkflowOnListItem' in type 'Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider'
Exception: Method 'StartWorkflowOnListItem' in type 'Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider'...
-
Last 17th July I had presented " Mobile Application development using .NET framework " at Aloashbei community get together . The...
-
Very recently, I have got this error message when try to browsing my developed application in asp.net. So I try to solve in many ways but fa...
-
This information help me a lot to solve my currency related calculation... so share with you. Hope that it may also helpful for other guys.....
No comments:
Post a Comment