ArrayList itemList = new ArrayList();
CharEnumerator CEnumerator = textBox1.Text.GetEnumerator();
while (CEnumerator.MoveNext())
{
byte[] array = new byte[1];
array = System.Text.Encoding.ASCII.GetBytes(CEnumerator.Current.ToString());
int asciicode = (short)(array[0]);
if (asciicode >= 48 && asciicode <= 57)
{
itemList.Add(CEnumerator.Current.ToString());
}
textBox2.Text = itemList.Count.ToString();
}
ArrayList itemList = new ArrayList();
CharEnumerator CEnumerator = textBox1.Text.GetEnumerator();
while (CEnumerator.MoveNext())
{
byte[] array = new byte[1];
array = System.Text.Encoding.ASCII.GetBytes(CEnumerator.Current.ToString());
int asciicode = (short)(array[0]);
if ((asciicode >= 48 && asciicode <= 57) || (asciicode >= 65 && asciicode <= 90) || (asciicode >= 97 && asciicode <= 122))
{
itemList.Add(CEnumerator.Current.ToString());
}
textBox2.Text = itemList.Count.ToString();
}