private void openFileDialog1_FileOk(object sender, CancelEventArgs e) { user_log("Arquivo selecionado: " + openFileDialog1.FileName.ToString()); // Open the file for reading. System.IO.StreamReader file = System.IO.File.OpenText(openFileDialog1.FileName); string str_codigo_hex = file.ReadToEnd(); codigo_atual.carregar_arquivo(str_codigo_hex); user_log("Lido:\n" + str_codigo_hex.Substring(0, 12) + "\n[...]\n" + str_codigo_hex.Substring(str_codigo_hex.Length - 12, 12)); user_log("Arquivo lido com sucesso."); richTextBox2.Clear(); export_vector(codigo_atual); //show_code(codigo_atual); // Set the MainWindow Title to the filename. this.Text = "Auxiliar de Gravador do nrf24le1 -- " + openFileDialog1.FileName.ToString(); file.Close(); // Close the file so as to not leave a mess. }