コード例 #1
0
ファイル: Compare2.cs プロジェクト: cedarwy/AppuimTestTools
        private void button3_Click(object sender, EventArgs e)
        {
            string build1 = path_1.Substring(path_1.LastIndexOf("build"), 14);
            //新建保存目录
            string ressavePath = ConfigurationManager.AppSettings["ResultPath"] + "\\Result\\" + build1 + "\\";
            Directory.CreateDirectory(ressavePath);

            //加载路径1的文件列表
            string[] filelist = Directory.GetFiles(this.path_1);
            foreach (string one in filelist)
            {
                string filename = one.Substring(one.LastIndexOf("\\") + 1);
                string name = filename.Split('_')[0] + filename.Split('_')[1];
                Filestatus status = new Filestatus();
                if (Filelist.ContainsKey(name))
                {
                    status = Filelist[name];
                }
                else
                {
                    Filelist.Add(name, status);
                }
                if(null == status.filepath1)
                    status.filepath1 = one;
                else if (null == status.filepath2)
                    status.filepath2 = one;
                else if (null == status.filepath3)
                    status.filepath3 = one;
                else if (null == status.filepath4)
                    status.filepath4 = one;
                status.filename = name;
                Filelist[name] = status;
            }
            loadPIC("测试结果");
        }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string build1 = path_1.Substring(path_1.LastIndexOf("build"), 14);
            //新建保存目录
            string ressavePath = ConfigurationManager.AppSettings["ResultPath"] + "\\Result\\" + build1 + "\\";

            Directory.CreateDirectory(ressavePath);

            //加载路径1的文件列表
            string[] filelist = Directory.GetFiles(this.path_1);
            foreach (string one in filelist)
            {
                string     filename = one.Substring(one.LastIndexOf("\\") + 1);
                string     name     = filename.Split('_')[0] + filename.Split('_')[1];
                Filestatus status   = new Filestatus();
                if (Filelist.ContainsKey(name))
                {
                    status = Filelist[name];
                }
                else
                {
                    Filelist.Add(name, status);
                }
                if (null == status.filepath1)
                {
                    status.filepath1 = one;
                }
                else if (null == status.filepath2)
                {
                    status.filepath2 = one;
                }
                else if (null == status.filepath3)
                {
                    status.filepath3 = one;
                }
                else if (null == status.filepath4)
                {
                    status.filepath4 = one;
                }
                status.filename = name;
                Filelist[name]  = status;
            }
            loadPIC("测试结果");
        }