Exemple #1
0
        void InitUserConfig()
        {
            #region 列名
            FileStream   fs = null;
            StreamReader sr = null;
            try
            {
                string ReakCfgPath = FunCommon.GetDir() + "/Config/GridViewColumnHeaders.cfg";

                fs = new FileStream(ReakCfgPath, FileMode.Open);
                sr = new StreamReader(fs, Encoding.Default);
                GlobalData.GridViewColumnHeaderTable = sr.ReadToEnd();
                GlobalData.GridViewColumnHeaderTable = GlobalData.GridViewColumnHeaderTable.Replace("\r\n", "");
                sr.Close();
                fs.Close();
            }
            catch
            {
                if (fs != null)
                {
                    fs.Close();
                }
                if (sr != null)
                {
                    sr.Close();
                }
            }
        }
        void ReadCfg(string CfgPath)
        {
            FileStream   fs = null;
            StreamReader sr = null;

            try
            {
                string ReakCfgPath = FunCommon.GetDir() + "/Config/SearchBoxCtrler/" + CfgPath + ".cfg";

                fs = new FileStream(ReakCfgPath, FileMode.Open);
                sr = new  StreamReader(fs, Encoding.Default);
                string Realte = sr.ReadLine();

                SearchColumns = FunCommon.CutToArry(Realte, ',');

                sr.Close();
                fs.Close();
            }
            catch
            {
                if (fs != null)
                {
                    fs.Close();
                }
                if (sr != null)
                {
                    sr.Close();
                }
            }
        }