Hello !
iam subhakar...in windows application, i am creating one interface
like two textboxs,one button.enter a string in first textbox when i click the button it display the ascii value in second textbox.but it did't get correct out put,i get a error "u do't convert string to int values".tell me correct soluation for this problem....
can anybody help me please..........
iam subhakar...in windows application, i am creating one interface
can anybody help me please..........
Niradhip ChakrabortyPosted Jul 10, 2009, 8:39 AM
int i = 0;
string strInput ="";
string strTemp ="";
//Hold the string value in strInput
strInput = textbox1.text
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.
textbox1.text = strTemp ;