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

            鏈接

            最新隨筆

            搜索

            最新評論

            久久影院午夜理论片无码 | 青春久久| 品成人欧美大片久久国产欧美...| 日本高清无卡码一区二区久久 | 国产成年无码久久久久毛片| 国产精品久久久久免费a∨| 99久久夜色精品国产网站 | 精品国产91久久久久久久a | 国内精品久久久久影院薰衣草| 亚洲综合精品香蕉久久网| 日韩精品无码久久久久久| 久久国产成人精品麻豆| 亚洲国产小视频精品久久久三级| www久久久天天com| 久久精品成人欧美大片| 少妇人妻88久久中文字幕| 少妇被又大又粗又爽毛片久久黑人| 色狠狠久久AV五月综合| 一级做a爱片久久毛片| 久久久久亚洲AV无码麻豆| 伊人久久大香线蕉综合热线| 国产免费福利体检区久久| 久久99热只有频精品8| 少妇无套内谢久久久久| 久久综合精品国产一区二区三区 | 精品久久久久久亚洲| 久久精品一区二区三区AV| 久久久久高潮综合影院| 久久国产精品一区| 青草影院天堂男人久久| 久久91精品国产91久久小草| 日产精品久久久久久久性色| 久久精品综合网| 久久频这里精品99香蕉久| 精品久久久久中文字幕一区| 国产999精品久久久久久| 久久香蕉一级毛片| 久久线看观看精品香蕉国产| 久久久久久久99精品免费观看| 97久久国产亚洲精品超碰热 | 色天使久久综合网天天|