Beispiel #1
0
        private void PerformanceTestrToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileStream fs = new FileStream("output.ini", FileMode.Open);

            byte[] data = new byte[fs.Length];
            fs.Read(data, 0, data.Length);
            string        Text    = Encoding.ASCII.GetString(data);
            MessageB      message = new MessageB();
            List <double> d       = new List <double>();

            for (int i = 0; i < 10; i++)
            {
                INIParse parse = new INIParse();
                DateTime dt    = DateTime.Now;
                parse.ParseINI(Text, false);
                TimeSpan ts = DateTime.Now - dt;
                d.Add(ts.TotalMilliseconds);
            }
            double a = 0;

            foreach (double da in d)
            {
                message.Print(da.ToString());
                a += da;
            }
            message.Print("avg:" + (a / 10).ToString());
            message.Show();
        }
Beispiel #2
0
        public void OpenFile(string Path)
        {
            treeView1.Nodes.Clear();
            INIFile  file  = INIFile.ReadFile(Path);
            INIParse parse = new INIParse();

            Data = parse.ParseINI(file.Content, true);
            List <TreeNode> temp = new List <TreeNode>();

            foreach (INISection section in Data)
            {
                TreeNode node = new TreeNode(section.Name);
                temp.Add(node);
            }
            treeView1.Nodes.AddRange(temp.ToArray());
        }