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

            <2018年4月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            精品无码久久久久久国产| 亚洲国产精品久久久久久| 久久久亚洲精品蜜桃臀| 无码任你躁久久久久久久| 伊人色综合九久久天天蜜桃| 亚洲中文字幕久久精品无码APP| 精品综合久久久久久888蜜芽| 久久亚洲高清观看| 无码国内精品久久综合88| 精品久久一区二区| 国产偷久久久精品专区| 久久久久综合网久久| 久久综合色老色| 99久久精品国产一区二区三区| 波多野结衣久久| 精品久久久久中文字幕一区| 久久精品亚洲一区二区三区浴池| 久久精品国产只有精品66| 久久久久99精品成人片试看 | 久久久国产精华液| 久久综合九色综合精品| 久久久久久久97| 少妇内射兰兰久久| 久久人人爽人人爽人人片AV麻烦| 日本道色综合久久影院| 久久精品国内一区二区三区| 久久狠狠爱亚洲综合影院| 亚洲国产精品综合久久一线| 精品久久人人妻人人做精品| 97精品伊人久久久大香线蕉| 91久久精品91久久性色| 久久久免费精品re6| 久久久无码精品亚洲日韩按摩| 久久久久se色偷偷亚洲精品av| 亚洲精品乱码久久久久久蜜桃| 国产精品成人99久久久久| 欧美日韩中文字幕久久伊人| 久久九九亚洲精品| 久久av高潮av无码av喷吹| 亚洲一区中文字幕久久| 久久久久99精品成人片三人毛片 |