帮忙改一下小程序!
private void openToolStripMenuItem_Click(object sender, EventArgs e){
OpenFileDialog opendialog = new OpenFileDialog();
opendialog.Filter = "Text Files(*.txt|*.txt|all files (*.*)|*.*)";
FileStream gfile = new FileStream(opendialog.FileNames, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
StreamReader myStreamReader;
string strline = myStreamReader.ReadLine();
//string sourceFileName = "E:\\1.txt"; //要读取的文件
// myStreamReader = @"opendialog .FileNames"; //打开源文件
while (myStreamReader.Peek() != -1)
{
//string myStr = myStreamReader.ReadLine(); //读去源文件
this.textBox1.Text += strline; //显示在控件中
}
}
}
错误 1 与“(string, , , )”最匹配的重载方法具有一些无效参数 D:\科目\C#\c# liujichao\p191\p191\Form1.cs 41 31 p191
错误 2 参数“1”: 无法从“string[]”转换为“string” D:\科目\C#\c# liujichao\p191\p191\Form1.cs 41 46 p191