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

            鏈接

            最新隨筆

            搜索

            最新評論

            久久久中文字幕| 久久精品综合一区二区三区| 丁香色欲久久久久久综合网| 亚洲中文久久精品无码| 国产成人精品久久一区二区三区| 国产免费久久精品丫丫| 久久精品极品盛宴观看| 91精品国产色综合久久| 性做久久久久久久久老女人| 蜜臀av性久久久久蜜臀aⅴ麻豆 | 国产成人精品久久一区二区三区| 久久线看观看精品香蕉国产| 狠狠色丁香婷婷久久综合五月| 国产精品无码久久久久久| 亚洲国产精品成人AV无码久久综合影院| 亚洲va久久久噜噜噜久久狠狠| 久久久久国产精品嫩草影院| 九九久久99综合一区二区| 国产精品99久久久精品无码| 中文字幕亚洲综合久久| 久久久久99精品成人片试看| 无码任你躁久久久久久| 国产精品美女久久久久av爽 | 大蕉久久伊人中文字幕| 成人综合久久精品色婷婷| 青青草原综合久久大伊人精品| 日韩精品久久无码中文字幕| 国产精品久久久久久久app| 久久综合五月丁香久久激情| 免费观看成人久久网免费观看| 777午夜精品久久av蜜臀| 亚洲伊人久久综合影院| 久久人人爽人人精品视频| 很黄很污的网站久久mimi色| 亚洲国产精品久久久久网站| 久久精品www人人爽人人| 亚洲女久久久噜噜噜熟女| 热re99久久6国产精品免费| 日韩精品久久久久久免费| 无码日韩人妻精品久久蜜桃| 婷婷五月深深久久精品|