• <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)

            鏈接

            最新隨筆

            搜索

            最新評論

            久久久久人妻一区二区三区vr| 久久精品无码一区二区三区免费| 亚洲国产天堂久久久久久| 久久精品综合一区二区三区| 久久亚洲高清观看| 久久国产高清字幕中文| 国产精品久久久久9999| 久久精品国产只有精品2020| 久久精品免费观看| 久久无码国产| 国产精品久久久久久久人人看| 囯产精品久久久久久久久蜜桃| 无码国内精品久久人妻蜜桃| 97久久婷婷五月综合色d啪蜜芽| 亚洲精品高清国产一线久久| 国产精品久久久久久| 精品久久久久久亚洲| 亚洲精品99久久久久中文字幕| 亚洲va中文字幕无码久久不卡| 无码人妻精品一区二区三区久久久| 国产成人综合久久综合| 久久亚洲高清综合| 国产成人久久精品一区二区三区| 久久青草国产手机看片福利盒子 | 久久综合亚洲欧美成人| 久久精品免费观看| 久久久久久久波多野结衣高潮 | 人人狠狠综合久久亚洲高清| 久久久久久曰本AV免费免费| 久久亚洲国产中v天仙www| 一级a性色生活片久久无少妇一级婬片免费放| 久久久无码精品亚洲日韩京东传媒| 成人久久综合网| 囯产极品美女高潮无套久久久 | 777久久精品一区二区三区无码| 要久久爱在线免费观看| 99久久精品费精品国产| 久久精品中文闷骚内射| 中文字幕无码免费久久| 久久国产成人午夜aⅴ影院 | 久久九九亚洲精品|