在Form1中,从ToolBox中拖个Button过来,然后再拖一个OpenFileDialog过来。
然后双击button1,在button1_Click函数中实现如下内容:
private:
System::Void button1_Click(System::Object * sender,
System::EventArgs * e)
{
if(openFileDialog1->ShowDialog() == DialogResult::OK)
{
System::IO::StreamReader * sr = new
System::IO::StreamReader(openFileDialog1->FileName);
MessageBox::Show(sr->ReadToEnd());
sr->Close();
}
}
即可。
【参考】
http://msdn.microsoft.com/en-us/library/aa984392(v=vs.71).aspx
http://msdn.microsoft.com/en-us/library/61097ykx.aspx#Y381
转载请注明:在路上 » VS2005编写ParseMP3窗口应用程序过程记录