• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天下

            記錄修行的印記

            IniFileGetValue,IniFileSetValue

            static CString GetAppDirectory()
            {
                CString sPath;
                GetModuleFileName(NULL,sPath.GetBuffer(MAX_PATH+1),MAX_PATH);
                //GetCurrentDirectory(MAX_PATH,sPath.GetBuffer(MAX_PATH+1));

                sPath.ReleaseBuffer ();
                int nPos;
                nPos=sPath.ReverseFind ('\\');
                sPath=sPath.Left(nPos+1);
                return sPath;
            }

            static CString IniFileGetValue(const CString& strFileName,const CString& strKeyPath,const CString& strDefault="")
            {
                CStringArray strKeys;
                CString strValue;
                int last_pos = 0;
                int pos;
                int new_pos;
                CString strKey;
                while (1)
                {
                    pos = strKeyPath.Find("/",last_pos);
                    new_pos = pos;
                    if (pos==-1)
                        new_pos = strKeyPath.GetLength();
                    strKey   = strKeyPath.Mid(last_pos,new_pos - last_pos);
                    last_pos = pos+1;
                    if (!strKey.IsEmpty())
                        strKeys.Add(strKey);
                    if (pos==-1)
                        break;
                }
                if (strKeys.GetSize()!=2)
                    return strDefault;
                GetPrivateProfileString(strKeys[0],strKeys[1],0,strValue.GetBuffer(4096),4095,strFileName);
                strValue.ReleaseBuffer();
                if (strValue.IsEmpty())
                    return strDefault;
                return strValue;
            }

            static BOOL IniFileSetValue(const CString& strFileName,const CString& strKeyPath,const CString& strValue)
            {
                CStringArray strKeys;
                int last_pos = 0;
                int pos;
                int new_pos;
                CString strKey;
                while (1)
                {
                    pos = strKeyPath.Find("/",last_pos);
                    new_pos = pos;
                    if (pos==-1)
                        new_pos = strKeyPath.GetLength();
                    strKey   = strKeyPath.Mid(last_pos,new_pos - last_pos);
                    last_pos = pos+1;
                    if (!strKey.IsEmpty())
                        strKeys.Add(strKey);
                    if (pos==-1)
                        break;
                }
                if (strKeys.GetSize()!=2)
                    return FALSE;
                
                return WritePrivateProfileString(strKeys[0],strKeys[1],strValue,strFileName);
            }

            posted on 2015-07-10 17:25 天下 閱讀(390) 評論(0)  編輯 收藏 引用 所屬分類: Win32

            <2013年4月>
            31123456
            78910111213
            14151617181920
            21222324252627
            2829301234
            567891011

            導航

            統(tǒng)計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            久久久久亚洲精品无码蜜桃| 国产精品欧美久久久久天天影视 | 激情伊人五月天久久综合| 久久久亚洲欧洲日产国码二区| 久久精品成人欧美大片| 91精品国产综合久久久久久| 国内精品久久久久久久久| 久久久亚洲裙底偷窥综合| 精品熟女少妇av免费久久| 久久精品国产色蜜蜜麻豆| 久久99国产乱子伦精品免费| 精品久久久久久无码中文野结衣 | 人妻精品久久久久中文字幕| 深夜久久AAAAA级毛片免费看| 亚洲人成无码久久电影网站| 国产综合免费精品久久久| 麻豆av久久av盛宴av| 国产精品成人久久久久久久| 国产精品久久新婚兰兰| 激情综合色综合久久综合| 色偷偷88888欧美精品久久久| 亚洲一区精品伊人久久伊人| 久久精品国产半推半就| 精品人妻久久久久久888| 色欲综合久久躁天天躁| 欧美黑人激情性久久| 免费无码国产欧美久久18| 久久综合久久性久99毛片| 99久久精品免费看国产一区二区三区 | 精品一二三区久久aaa片| 久久99热这里只有精品国产 | 久久人做人爽一区二区三区| 91精品国产高清久久久久久91 | 久久综合视频网| 91视频国产91久久久| 免费精品国产日韩热久久| 国产美女久久久| 久久99国产精一区二区三区| 亚洲中文字幕久久精品无码喷水 | 国内精品伊人久久久影院| 久久人人爽人人爽AV片|