Skip to content

Instantly share code, notes, and snippets.

@vmussak
Created April 6, 2016 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmussak/8edbff0ecb8e9edd9a61c82271b99f42 to your computer and use it in GitHub Desktop.
Save vmussak/8edbff0ecb8e9edd9a61c82271b99f42 to your computer and use it in GitHub Desktop.
int[] numeros = new int[10];
//Supondo que o seu TextBox tenha o nome "txtNumero"
//Exemplo 01 - Conversão explícita
int n = (int)txtNumero.Text;
numeros[0] = n;
//Exemplo 02 - int.Parse
int n = int.Parse(txtNumero.Text);
numeros[0] = n;
//Exemplo 03 - Convert
int n = Convert.ToInt32(txtNumero.Text);
numeros[0] = n;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment