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

            <2015年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            成人综合久久精品色婷婷| 亚洲一本综合久久| 久久亚洲AV成人无码软件| 久久亚洲AV成人出白浆无码国产| 99久久无色码中文字幕人妻| 久久艹国产| 久久无码AV中文出轨人妻| 国产成人无码久久久精品一| 国产精自产拍久久久久久蜜| 嫩草伊人久久精品少妇AV| 国内精品久久久久影院网站| 无遮挡粉嫩小泬久久久久久久| 国产成人精品久久亚洲| 人妻少妇久久中文字幕| 久久久久久青草大香综合精品| 亚洲va国产va天堂va久久| 久久精品国产亚洲一区二区三区| 久久国产色AV免费观看| 久久精品国产男包| 久久亚洲国产精品123区| 99久久99久久精品国产| 亚洲av成人无码久久精品| 久久av免费天堂小草播放| 国产精品久久久久久福利漫画 | 精品久久久无码21p发布| 国产欧美久久一区二区| 久久99精品久久久大学生| 少妇无套内谢久久久久| 亚洲国产精品无码久久九九| 国产成人精品久久亚洲高清不卡 | 久久综合88熟人妻| 久久不见久久见免费视频7| 久久久久无码精品国产| 欧美va久久久噜噜噜久久| 久久久久亚洲精品无码蜜桃| 国产69精品久久久久9999APGF| 久久99久久99精品免视看动漫| 精品久久久无码人妻中文字幕| 伊人久久大香线蕉av不卡| 亚洲狠狠婷婷综合久久久久| 日本久久久久亚洲中字幕|