读写INI:

 首先,得到当前exe的运行路径  
  ApplicationPath   =   Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);  
  下面是操作INI文件的类  

Windows Mobile 读写配置文件using System;
Windows Mobile 读写配置文件
using System.Runtime.InteropServices;
Windows Mobile 读写配置文件
using System.Text;
Windows Mobile 读写配置文件
using System.IO;
Windows Mobile 读写配置文件
Windows Mobile 读写配置文件
namespace Ini

使用方法  
  写信息文件  
  IniFile   NewIni   =   new   IniFile(ApplicationPath   +   "\\Test.ini");  
  NewIni.IniWriteValue("测试信息","测试一","1");  
   
  读取  
  IniFile   NewIni   =   new   IniFile(ApplicationPath   +   "\\Test.ini");  
  string   a   =   NewIni   .IniReadValue("测试信息","测试一");  
   
  读取结果  
  a   =   1

 备注:以上代码在HP   2490(WM5)上测试通过

 

 


 

 

相关文章:

  • 2021-06-09
  • 2021-08-26
  • 2021-11-04
  • 2021-11-02
  • 2021-07-16
  • 2021-10-26
猜你喜欢
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2022-02-21
相关资源
相似解决方案