• <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 天下 閱讀(380) 評論(0)  編輯 收藏 引用 所屬分類: Win32

            <2015年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            久久婷婷五月综合色99啪ak| 国产精品成人99久久久久 | 久久婷婷五月综合色奶水99啪| 久久精品成人欧美大片| 亚洲国产小视频精品久久久三级 | 久久AV高清无码| 精品久久久久久久久久中文字幕| 欧美大战日韩91综合一区婷婷久久青草| 久久亚洲视频| 国产日产久久高清欧美一区| 欧洲国产伦久久久久久久| 老色鬼久久亚洲AV综合| 国产高清美女一级a毛片久久w| 久久久久久久久久久精品尤物| 免费精品99久久国产综合精品| 国产精品久久久久久五月尺| 69久久精品无码一区二区| 久久天天躁狠狠躁夜夜2020老熟妇 | 久久精品国产亚洲av麻豆色欲| 99久久精品免费观看国产| 久久亚洲AV成人无码国产| 亚洲综合久久久| 久久亚洲精品无码播放| 久久婷婷综合中文字幕| 久久综合狠狠综合久久| 精品久久久久久中文字幕大豆网| 久久久久久久国产免费看| 国产成人久久精品麻豆一区| 久久精品亚洲精品国产色婷| 久久精品人妻中文系列| 三级片免费观看久久| 久久久久久国产精品无码下载| 成人亚洲欧美久久久久 | 一本一道久久a久久精品综合 | 久久国产欧美日韩精品| 中文字幕精品久久| 亚洲?V乱码久久精品蜜桃| 久久五月精品中文字幕| 欧美久久天天综合香蕉伊| 内射无码专区久久亚洲| 一本色综合久久|