• <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>
            C++-----勇者無敵  
            流媒體、分布式實(shí)時系統(tǒng)、外掛、設(shè)計模式、C#
            日歷
            <2008年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789
            統(tǒng)計
            • 隨筆 - 4
            • 文章 - 0
            • 評論 - 1
            • 引用 - 0

            導(dǎo)航

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案(4)

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

             

            using System;
            using System.IO;
            using System.Runtime.InteropServices;
            using System.Text;


            namespace OperateIni
            {
            public class IniFile
            {
              
            private string IniFileName;

               [DllImport(
            "kernel32")]
              
            private static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName,
               
            int nDefault, string lpFileName);

               [DllImport(
            "kernel32")]
              
            private static extern int GetPrivateProfileString(string lpAppName, string lpKeyName,
               
            string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);

               [DllImport(
            "kernel32")]
              
            private static extern bool WritePrivateProfileString(string lpAppName,
               
            string lpKeyName, string lpString, string lpFileName);

              
            public IniFile(string Filename)
               {
                   IniFileName
            = Filename;
               }
              
              
            public int ReadIni(string Section,string Key,int Default)
               { 
                  
            return GetPrivateProfileInt(Section,Key,Default,IniFileName);
               }

              
            public string ReadIni(string Section,string Key,string Default)
               { 
                   StringBuilder temp
            = new StringBuilder(1024); 
                  
            int rec=GetPrivateProfileString(Section,Key,Default,temp,1024,IniFileName);
                  
            return temp.ToString();
               }

              
            public void WriteIni(string Section,string Key,int intValue)
               { 
                   WritePrivateProfileString(Section,Key,intValue.ToString(),IniFileName);
               }

              
            public void WriteIni(string Section,string Key,string strValue)
               { 
                   WritePrivateProfileString(Section,Key,strValue,IniFileName);
               }
            }
            }

            最好是加上判斷文件是否存在,不存在則進(jìn)行創(chuàng)建文件、錯誤處理等功能。

            posted on 2008-07-30 17:10 李明坤 閱讀(833) 評論(0)  編輯 收藏 引用

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


             
            Copyright © 李明坤 Powered by: 博客園 模板提供:滬江博客
            久久精品国产黑森林| 久久久久高潮综合影院| 日韩久久久久久中文人妻| 狠狠88综合久久久久综合网| 久久精品国产91久久麻豆自制| 一级做a爰片久久毛片人呢| 亚洲综合久久久| 久久国产高清一区二区三区| 久久久无码精品亚洲日韩蜜臀浪潮 | 久久久久久久久波多野高潮| 国内精品久久久人妻中文字幕| 久久久久这里只有精品| jizzjizz国产精品久久| 亚洲伊人久久综合影院| 久久99国产精品成人欧美| 无码人妻精品一区二区三区久久| 久久久久国色AV免费观看| 麻豆成人久久精品二区三区免费| 久久精品国产WWW456C0M| 国产精品久久国产精品99盘 | 天天久久狠狠色综合| 潮喷大喷水系列无码久久精品| 香蕉99久久国产综合精品宅男自| 久久久久香蕉视频| 91久久精品国产91性色也| 久久午夜无码鲁丝片| 天堂久久天堂AV色综合| 一级做a爰片久久毛片免费陪| 91精品国产高清久久久久久国产嫩草| 久久综合精品国产二区无码| 久久亚洲AV无码精品色午夜| 午夜天堂av天堂久久久| 囯产精品久久久久久久久蜜桃 | 久久久久人妻一区二区三区vr| 日韩人妻无码一区二区三区久久99| 99久久精品免费看国产免费| 亚洲伊人久久大香线蕉苏妲己| 狠狠精品干练久久久无码中文字幕| 97超级碰碰碰碰久久久久| 久久久久国色AV免费观看| 亚洲精品美女久久久久99小说|