透明的向往吧 关注:49贴子:1,506
  • 6回复贴,共1
@FD_Moder_Ex


1楼2012-07-21 13:05回复
    我试着往listbox里全部读取INI段。。。发现比起你的来我的效率弱爆了。
    求 解决方案 您不会用的是指针吧……
    ---------------------------------------------------------------------------
    private butLiseSec_Click()
    {
    ——ClassDisposeINI a=new ClassDisposeINI ();//后面的那个引用过来
    ——int i = 0;
    ——int iMax=a.ReadFileSectionNumber (txtFilePath.Text );//获取总段数
    ——string cc = txtFilePath.Text;//INI路径
    ——listBox.Items.Clear();
    ——for (i=0; i <= iMax;i++ )
    ——{
    ————listBox.Items.Add(a.ReadSectionbyIndex(i, cc));
    ——}
    }
    ClassDisposeINI
    ------------------------------------------------------------------------------
    public string ReadSectionbyIndex(int Index, string FilePath)
    {
    ——string strBetween;//dim strBetween as string
    ——strBetween = strINI.Replace("\r\n[", "@").Split('@')[Index].Split (']')[0];
    ——return strBetween;
    }
    public int ReadFileSectionNumber(string FilePath)
    {
    ——int strNumber;
    ——if (hasBeenReadin != 2)//判断是否重新读取文件
    ——{
    ————GetINIFile(FilePath);
    ——}
    ——strNumber = strINI.Replace("]\r\n", "@").Split('@').Length;
    ——return strNumber-1 ;
    }


    2楼2012-07-21 13:17
    回复
      不是...我貌似也用的很简单的东西...咱玩什么都是学艺不精...只倒弄些表皮...


      IP属地:上海3楼2012-07-21 16:59
      收起回复
        好吧效率上来了……


        4楼2012-07-22 07:08
        收起回复