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

            <2016年6月>
            2930311234
            567891011
            12131415161718
            19202122232425
            262728293012
            3456789

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            国产精品久久久久久福利漫画| 99久久国产综合精品网成人影院 | 综合久久久久久中文字幕亚洲国产国产综合一区首 | 精品国际久久久久999波多野| 亚洲香蕉网久久综合影视| 亚洲成色WWW久久网站| 久久99国内精品自在现线| 国产精品99久久精品| 久久久91人妻无码精品蜜桃HD| 99久久无码一区人妻| 热RE99久久精品国产66热| 伊人久久大香线蕉综合热线| 久久久久亚洲AV片无码下载蜜桃| 精品国产一区二区三区久久久狼| 99久久精品国产一区二区| 一本综合久久国产二区| 国产精品久久久久无码av| 无码国内精品久久人妻麻豆按摩 | 久久久久久国产精品无码下载 | 久久91精品国产91| 精品久久久久久国产潘金莲| 久久久久久A亚洲欧洲AV冫| 看久久久久久a级毛片| 精品综合久久久久久88小说| 久久人人爽人人爽人人片AV高清| 国产精品久久久久9999| 国产精品久久久久久久久软件| 精品熟女少妇AV免费久久| 丁香久久婷婷国产午夜视频| 一本久久a久久精品vr综合| 久久精品亚洲男人的天堂| 国产成人精品白浆久久69| 久久精品桃花综合| 国产精品99久久久久久猫咪 | 欧美噜噜久久久XXX| 亚洲а∨天堂久久精品| 国产精品久久成人影院| 久久无码人妻一区二区三区午夜| 色99久久久久高潮综合影院| 亚洲精品高清久久| 99久久精品国产麻豆|