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

            鏈接

            最新隨筆

            搜索

            最新評論

            欧美日韩中文字幕久久伊人| 99久久国产综合精品女同图片| 久久99这里只有精品国产| 色综合久久无码五十路人妻| 亚洲国产精品久久| 久久国产劲爆AV内射—百度| 国产精品久久久久久影院 | 欧美精品一区二区精品久久 | 久久久久久久久66精品片| 亚洲成色www久久网站夜月| 国产成人久久精品区一区二区| 久久免费大片| 91精品久久久久久无码| 奇米影视7777久久精品人人爽| 亚洲国产精品久久久久婷婷老年 | 狠狠色噜噜色狠狠狠综合久久| 日本精品久久久中文字幕| 亚洲午夜久久久久妓女影院| 国产69精品久久久久99| 国产精品九九九久久九九| 亚洲午夜精品久久久久久浪潮 | 性欧美大战久久久久久久| 91久久成人免费| 精品少妇人妻av无码久久| 色婷婷综合久久久中文字幕| 亚洲人成精品久久久久| 久久丝袜精品中文字幕| 99久久精品免费看国产一区二区三区| 天天躁日日躁狠狠久久| 思思久久99热只有频精品66| 亚洲精品乱码久久久久久蜜桃 | 日韩精品久久久肉伦网站| 久久久久99这里有精品10| 日本高清无卡码一区二区久久| 99精品久久精品一区二区| 久久最新免费视频| 精品久久国产一区二区三区香蕉 | 亚洲欧美国产精品专区久久| 久久久久国产日韩精品网站| 国内精品伊人久久久久妇| 亚洲v国产v天堂a无码久久|