dotnet-Snippets.com
Snippets: 57 | Registered User: 27 | Visitors online: 8
Main Menu

Home
Random Snippet
FAQs
Contact Us
Imprint
RSS Feeds

Rss All languages
Rss C#
Rss VB.NET
Rss C++
Rss J#
Rss ASP.NET
Google Ads

Sri Lanka .NET 
                Forum Member
ASCII to Hex

Author: Guest
Programming Language: C# Rating:
not yet rated

Views: 694

Description:

Converted an ASCII-Text to an String with Hex-Values.



C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// <summary>
/// Helper-Method
/// Converted an ASCII-Text to Hex-Value
/// </summary>
/// <param name="i_asciiText">ASCII-Text</param>
/// <returns>String with Hex-Representation</returns>
private String convertAsciiTextToHex(String i_asciiText)
{
	StringBuilder sBuffer = new StringBuilder();
	for (int i = 0; i < i_asciiText.Length; i++)
	{
		sBuffer.Append(Convert.ToInt32(i_asciiText[i]).ToString("x"));
	}
	return sBuffer.ToString().ToUpper();
}

This Snippets could be interesting for you:
No results available

Poor Excellent
1 2 3 4 5 6 7 8 9 10
Sign in to vote for this snippet.

Comments:
(Please log in to wrtite an comment.)