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

            <2012年6月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            1234567

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            久久精品中文字幕大胸| 青青青青久久精品国产 | 久久美女网站免费| 久久免费精品一区二区| 久久免费大片| 亚洲午夜久久久久久久久电影网| 99久久无色码中文字幕人妻| 久久国产免费观看精品3| 久久婷婷久久一区二区三区| 偷窥少妇久久久久久久久| 色综合久久无码中文字幕| 91麻精品国产91久久久久| 久久久久久精品免费免费自慰| av无码久久久久不卡免费网站| 久久国产乱子伦精品免费午夜| 久久人人爽人人爽人人片AV东京热 | 天堂久久天堂AV色综合| 国内精品伊人久久久久影院对白| 久久99热这里只有精品66| 久久青青草原综合伊人| 日韩乱码人妻无码中文字幕久久 | 无码伊人66久久大杳蕉网站谷歌 | 亚洲愉拍99热成人精品热久久 | 久久电影网一区| 色综合久久综合中文综合网| 日韩美女18网站久久精品| 久久精品国产第一区二区三区| 国产亚洲精久久久久久无码AV| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 九九久久精品国产| 国产69精品久久久久777| 久久www免费人成精品香蕉| 久久无码人妻一区二区三区午夜| 成人精品一区二区久久| 久久99国产精一区二区三区| 亚洲精品白浆高清久久久久久| 久久青青色综合| 久久综合偷偷噜噜噜色| 久久免费香蕉视频| 88久久精品无码一区二区毛片| 东京热TOKYO综合久久精品|