标题:帮忙改一下小程序!
只看楼主
liuchaofeiren
Rank: 1
来 自:山东
等 级:新手上路
帖 子:18
专家分:0
注 册:2008-2-24
 问题点数:0 回复次数:2 
帮忙改一下小程序!
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
搜索更多相关主题的帖子: opendialog string txt FileStream 
2008-06-09 08:33
hebingbing
Rank: 6Rank: 6
来 自:黄土高坡
等 级:贵宾
威 望:27
帖 子:3417
专家分:371
注 册:2007-10-22
得分:0 
FileStream gfile = new FileStream(opendialog.FileNames, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
(string, , , )
对比一下……
2008-06-09 10:04
liuchaofeiren
Rank: 1
来 自:山东
等 级:新手上路
帖 子:18
专家分:0
注 册:2008-2-24
得分:0 
找不出来啊!
高手请在指点一下吧!
2008-06-09 16:25



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-218290-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.362583 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved