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

            <2013年4月>
            31123456
            78910111213
            14151617181920
            21222324252627
            2829301234
            567891011

            導航

            統(tǒng)計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            青青青伊人色综合久久| 久久青青草原精品国产不卡| 久久夜色精品国产噜噜噜亚洲AV | 久久国产精品77777| 国产亚洲精久久久久久无码AV| 国产91久久综合| 一本色道久久HEZYO无码| 久久久久久免费一区二区三区| 亚洲精品国产第一综合99久久| 99久久精品费精品国产一区二区| 尹人香蕉久久99天天拍| 欧美久久一区二区三区| 久久久久高潮毛片免费全部播放| 精品人妻伦九区久久AAA片69| 久久人妻少妇嫩草AV无码专区| 精品人妻伦九区久久AAA片69| 77777亚洲午夜久久多人| 久久精品?ⅴ无码中文字幕| 久久国产亚洲精品无码| 国内精品伊人久久久久妇| 久久艹国产| 91精品国产91热久久久久福利| 99久久久精品免费观看国产| 亚洲国产精品成人久久| 久久精品国产久精国产果冻传媒| 人妻系列无码专区久久五月天| 91精品观看91久久久久久| 99久久免费国产精品热| 国产精品久久一区二区三区| 人妻少妇久久中文字幕一区二区| 久久成人国产精品免费软件| 国产69精品久久久久观看软件| 香蕉99久久国产综合精品宅男自 | 精品久久久久久无码免费| 国产精品青草久久久久婷婷| 99久久人妻无码精品系列蜜桃| 99久久精品费精品国产一区二区| 久久精品成人免费看| 久久91这里精品国产2020| 青春久久| 久久男人Av资源网站无码软件 |