using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.IO; using System.Windows.Forms;
namespaceMediaPlayer { publicpartialclassForm6 : Form { private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer2 = new AxWMPLib.AxWindowsMediaPlayer(); PictureBox pictureBox2 = new PictureBox(); privateint t = 0; privateint count = 0; privatestring filename; privatestring[] info = newstring[100];
if (!info[count].Equals("end#")) { if (t == Int32.Parse(info[count].Substring(0, info[count].IndexOf(']')))) { richTextBox1.Text = info[count].Substring(info[count].IndexOf(']') + 1);
count++; } }
}
privatevoidbutton1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); filename = openFileDialog1.FileName; try { // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. using (StreamReader sr = new StreamReader(filename)) { String line; int i = 0; // Read and display lines from the file until the end of // the file is reached. while ((line = sr.ReadLine()) != null) { info[i] = line; i++; } sr.Close(); } } catch (Exception a) { // Let the user know what went wrong. MessageBox.Show("读取错误");