标题:读取文件问题
取消只看楼主
奇异芒果
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-2-1
结帖率:0
已结贴  问题点数:20 回复次数:0 
读取文件问题
我是个初学者,看了段读取文件的代码,不太懂,请大神指点,下面的源代码有两个地方有问题
                        static void GetData()
        {
            StreamReader reader = new StreamReader(Environment.CurrentDirectory + "//观测值表.txt", Encoding.UTF8);
            
            string now_line;
            while(true)
            {
                now_line = reader.ReadLine();
                if (now_line != null)
                {
                    if (now_line[0] == '控')
                    {
                        char[] sep = { '(', ',', ')', ':', ':' };//请问这里表示什么意思
                        string[] data = now_line.Split(sep);//还有这里表示什么意思
                        
                        int num = (data.Length - 2) / 4;
                        for (int i = 0; i < num; i++)
                        {
                            Point nx = new Point();
                            nx.Id = int.Parse(data[1 + 4 * i]);
                            nx.Type = Point.PointTypes.起算点;
                            nx.X = double.Parse(data[3 + 4 * i]);
                            nx.Y = double.Parse(data[4 + 4 * i]);
                            nx.X0 = nx.X;
                            nx.Y0 = nx.Y;

                            KnownPoints.Add(nx);
                            StartPoints.Add(nx);
                            AllPoint.Add(nx);

                        }
                        
                        break;
                    }
                }
            }
搜索更多相关主题的帖子: 源代码 null 
2015-04-12 15:47



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




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

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