int n = 0; for (int i = 0; i < 9; i++) n += (i+1) * (Convert.ToInt16(textBox1.Text[i].ToString())); int nl = n % 11; if (nl == 10) nl = 0; if (nl == (Convert.ToInt16(textBox1.Text[9].ToString()))) MessageBox.Show("A megadott adóazonosító jel létező!"); else MessageBox.Show("A megadott adóazonosító jel helytelen!")