int x = 0; if (x is System.String) MessageBox.Show("this is a string"); if (x is System.Int32) MessageBox.Show("this is an int");