hi Guys
can you please help me I'm trying to change a string to a asccii symbols using this code using VS studios 2008(the problem happens in both 2.0 and 3.5 frameworks )
System.Text.Encoding _ascii = System.Text.Encoding.ASCII;
byte[] _asciiDate = _ascii.GetBytes("010601120000");
string _outBuff = "";
for (int i = 0; i < _asciiDate.Length; i++)
_outBuff = _outBuff + _asciiDate[i].ToString () + " ";
MessageBox.Show(_outBuff);
but the problem it outputs the string in a html format(according to asscii table)
can someone please tell me what I might be doing wrong
Loading
Niradhip ChakrabortyPosted Jun 24, 2009, 5:18 AM
int i = 0;
string strInput ="";
string strTemp ="";
//Hold the string value in strInput
for (i = 0; i <= strInput.Length - 1; i++)
{
int charValue = Convert.ToInt32(strInput[i]); // converting in ascii
if( strTemp =="")
{
strTemp = Convert.ToString(charValue);
}
else
{
strTemp = strTemp + Convert.ToString(charValue);
}
}
Now strTemp will give u the ascii code.