Example #1
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");
                }
            }
        }
Example #2
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]);
            }
        }