public partial class Form1 : Form { private string productName = string.Empty; private string FrmvareVs = string.Empty; private string RlsDate = string.Empty; private string HexFile = string.Empty; private string cmssnWizard = string.Empty; private string InstalationVer = string.Empty; private string LbdDependent = string.Empty; private string HelpDependent = string.Empty; string strProductPath = string.Empty; private string filePath = string.Empty; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "Iss Files (.iss)|*.iss|All Files (*.*)|*.*"; openFileDialog1.FilterIndex = 1; if (openFileDialog1.ShowDialog() == DialogResult.OK) { textBox1.Text = openFileDialog1.FileName; // Open the selected file to read. System.IO.Stream fileStream = openFileDialog1.OpenFile(); string readContents; using (System.IO.StreamReader reader = new System.IO.StreamReader(fileStream)) { readContents = reader.ReadToEnd(); //textBox4.Text = readContents; fileStream.Close(); }
myTextBox.Text = System.IO.File.ReadAllText(myFileName);
using (StreamReader sr = File.OpenText(fileName)) { Textbox.Text = sr.ReadToEnd(); //you then have to process the string }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)