Ejemplo n.º 1
0
 private void FxjReader_Load(object sender, EventArgs e)
 {
     FxjData fxj = new FxjData();
     //string[] dataTypeNames = fxj.GetTables("");
     string[,] tableNames = fxj.GetTables();
     for (int i = 0; i < tableNames.GetLength(0); i++)
     {
         dataType.Items.Add(tableNames[i,0]+"-"+tableNames[i,1]);
     }
 }
Ejemplo n.º 2
0
        private void FxjConverter_Load(object sender, EventArgs e)
        {
            FxjData fxj = new FxjData();
            if (fxj.FxjPath == "")
            {
                fxjPath.Text = "û���ҵ������ң�";
                fxjPath.ForeColor = Color.Red;
            }
            else
            {
                this.fxjPath.Text = fxj.FxjPath;
                this.ver.Text = fxj.Version;
                if (fxj.GetMarkets().GetLength(0) > 0)
                {
                    TreeNode[] marketNode = new TreeNode[fxj.GetMarkets().GetLength(0) + 1];
                    treeView1.ExpandAll();
                    for (int i = 0; i < fxj.GetMarkets().GetLength(0); i++)
                    {
                        DirectoryInfo dir = new DirectoryInfo(fxj.FxjPath + @"\data\" + fxj.GetMarkets()[i, 0].Trim());
                        if (dir.Exists)
                        {
                            marketNode[i] = treeView1.Nodes.Add(fxj.GetMarkets()[i, 1]);
                            string[,] tables = fxj.GetTables();
                            for (int j = 0; j < tables.GetLength(0); j++)
                            {
                                if ("..SH,SZ,".IndexOf(fxj.GetMarkets()[i, 0].ToUpper()) > 0 && tables[j, 0].ToLower() != "bk")  //�
                                {
                                    if (File.Exists(fxj.FxjPath + @"data\" + fxj.GetMarkets()[i, 0] + @"\" + tables[j, 2]) ||
                                        ",,,fp,gb,gd,cw,jjjz,jjzh".IndexOf(tables[j, 0].ToLower()) > 0 && File.Exists(fxj.FxjPath + @"data\" + tables[j, 2]))
                                    {
                                        marketNode[i].Nodes.Add(tables[j, 1] + "|" + fxj.GetMarkets()[i, 0].ToLower() + "|" + tables[j, 0] + "|" + fxj.GetMarkets()[i, 0].ToLower() + tables[j, 0] + ".txt|" + tables[j, 2]);
                                    }

                                }
                                else   //�����г�
                                {
                                    if (File.Exists(fxj.FxjPath + @"data\" + fxj.GetMarkets()[i, 0] + @"\" + tables[j, 2]))
                                    {
                                        if (",,,fp,gb,gd,cw,jjjz,jjzh".IndexOf(tables[j, 0].ToLower()) <= 0 && tables[j, 0].ToLower() != "bk")
                                        {
                                            marketNode[i].Nodes.Add(tables[j, 1] + "|" + fxj.GetMarkets()[i, 0].ToLower() + "|" + tables[j, 0] + "|" + fxj.GetMarkets()[i, 0].ToLower() + tables[j, 0] + ".txt|" + tables[j, 2]);
                                        }
                                    }

                                }
                            }

                            foreach (FileInfo file in dir.GetFiles(@"*.PRP"))
                            {
                                marketNode[i].Nodes.Add("��ʷ�ֱʳɽ�|" + fxj.GetMarkets()[i, 0].ToLower() + "|hqmb|"+ fxj.GetMarkets()[i, 0].ToLower()+"hqmb" + file.Name.Substring(0, file.Name.IndexOf(".")) + ".txt|" + file.Name);
                            }
                        }
                    }
                    marketNode[fxj.GetMarkets().GetLength(0)] = treeView1.Nodes.Add("��������");
                    marketNode[fxj.GetMarkets().GetLength(0)].Nodes.Add("���|ss|bk|bk.txt|block.def");
                    marketNode[fxj.GetMarkets().GetLength(0)].Nodes.Add("����|ss|pj|pj.txt|����.str");
                }
            }
        }