• <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无码| 狠狠色丁香婷婷综合久久来| 91久久精品电影| 久久亚洲AV无码精品色午夜麻豆| 久久99久久99精品免视看动漫| 99久久国产综合精品成人影院| 日日狠狠久久偷偷色综合96蜜桃 | 7777精品伊人久久久大香线蕉 | 国产精品亚洲美女久久久| 欧美精品丝袜久久久中文字幕 | 日韩精品国产自在久久现线拍| 亚洲精品第一综合99久久| 国产91色综合久久免费| 亚洲日本久久久午夜精品| 国产精品久久久亚洲| 久久久久av无码免费网| 久久久国产一区二区三区| 97久久香蕉国产线看观看| 久久人人爽人人人人片av| 四虎国产精品成人免费久久| 青青热久久综合网伊人| 99久久国语露脸精品国产| 久久精品a亚洲国产v高清不卡 | 亚洲狠狠久久综合一区77777| 中文精品久久久久人妻不卡| 亚洲精品国产自在久久| 久久精品无码一区二区三区日韩| 久久精品免费观看| 久久精品国产精品亚洲精品| 精品永久久福利一区二区| 久久精品国产第一区二区三区| 亚洲国产另类久久久精品| 午夜精品久久久久久毛片| 久久婷婷五月综合97色一本一本| 亚洲精品无码久久千人斩| 无码AV波多野结衣久久| 久久精品国产亚洲AV嫖农村妇女| 国内精品人妻无码久久久影院 | 色偷偷888欧美精品久久久| 久久精品国产99国产精品澳门|