1. //读写INI
  2. public class GF_INI
  3. {
  4. [DllImport("kernel32")]
  5. private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
  6. [DllImport("kernel32")]
  7. private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
  8. [DllImport("kernel32.dll")]
  9. public static extern int Beep(int dwFreq, int dwDuration);
  10.  
  11. //读ini
  12. public static void iniFile_SetVal(string in_filename, string Section, string Key, string Value)
  13. {
  14. WritePrivateProfileString(Section, Key, Value, in_filename);
  15. }
  16.  
  17. //写INI
  18. public static string iniFile_GetVal(string in_filename, string Section, string Key)
  19. {
  20. StringBuilder temp = new StringBuilder(255);
  21. int i = GetPrivateProfileString(Section, Key, "", temp, 255, in_filename);
  22. if (i == 0)
  23. return "";
  24. else
  25. return temp.ToString();
  26. }
  27. }

最新文章

  1. 基于mysql的数据管理
  2. 《DSP using MATLAB》示例Example5.20
  3. centos7 firewalld
  4. How to: Convert Between Various String Types
  5. java 26 - 7 网络编程之 TCP协议代码优化
  6. php发送邮件处理功能页面去除重复的邮箱地址
  7. 字符串 - 近似回文词 --- csu 1328
  8. beej's 网络编程 打包数据pack data
  9. BZOJ 1617 渡河问题
  10. JVM调优总结 -Xms -Xmx -Xmn -Xss(转载)
  11. 缓存初解(三)---Spring3.0基于注解的缓存配置+Ehcache和OScache
  12. [改善Java代码]用整数类型处理货币
  13. PHP学习笔记十三【二维数组】
  14. live555 for Android
  15. PHP的魔法方法
  16. Git版本控制之多人协作
  17. Android和iOS中Cocos2D日志为什么会出现skip frames
  18. luogu P1602 Sramoc问题
  19. arrow function and bind
  20. html或者jsp页面刷新问题

热门文章

  1. C#与js的各种交互
  2. zw版【转发·台湾nvp系列Delphi例程】HALCON SetLineStyle2
  3. 五、Java基础---------if else、switch总结
  4. 为什么在我眼里你是一只傻逼——傻逼“常所用”句型之(2)——“当当网的就有XXX人评论,YYY%的推荐”
  5. SqlServer 的提示符(Option/With等提示符)不是什么时候都可以用的
  6. intall vs code in elementary os
  7. Android 多线程通信 访问网络
  8. Mongodb 笔记06 副本集的组成、从应用程序连接副本集、管理
  9. 使用 Delphi Xe 的 TDictionary
  10. Linux终端乱码的解决办法