文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>c#读写INI

c#读写INI

时间:2011-05-06  来源:落冰

//读写INI
public class GF_INI
{
[DllImport(
"kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport(
"kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
[DllImport(
"kernel32.dll")]
public static extern int Beep(int dwFreq, int dwDuration);

//读ini
public static void iniFile_SetVal(string in_filename, string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, in_filename);
}

//写INI
public static string iniFile_GetVal(string in_filename, string Section, string Key)
{
StringBuilder temp
= new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, "", temp, 255, in_filename);
if (i == 0)
return "";
else
return temp.ToString();
}
}
相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载