INI文件的操作(ASP.NET+C#)
2020-12-13 02:38
标签:style class ext color c int INI文件的操作(ASP.NET+C#) (一)INIFile.cs using System; public INIFile(string INIPath) [DllImport("kernel32")] [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, public void IniWriteValue(string Section,string Key,string Value) int i = GetPrivateProfileString(Section,Key,"",temp, 255, this.path); return temp.ToString(); } } ======================================================= (二)使用示例 string iniFile = @"D:\Bug2000.ini"; INIFile myINI = new INIFile(iniFile); for(i=0;i INI文件的操作(ASP.NET+C#),搜素材,soscw.com INI文件的操作(ASP.NET+C#) 标签:style class ext color c int 原文地址:http://blog.csdn.net/tbmqzmavp/article/details/25395541
using System.Runtime.InteropServices;
using System.Text;
namespace CreateWebDir
{
///
/// INIFile 的摘要说明。
///
public class INIFile
{
public string path;
{
path = INIPath;
}
private static extern long WritePrivateProfileString(string section,
string key,string val,string filePath);
string key,string def, StringBuilder retVal,int size,string filePath);
{
WritePrivateProfileString(Section,Key,Value,this.path);
}
public string IniReadValue(string Section,string Key)
{
StringBuilder temp = new StringBuilder(255);
}
if (!File.Exists(iniFile))
{
using (FileStream fs = File.Create(iniFile))
{
fs.Close();
}
}
myINI.IniWriteValue("WebDir","arg"+i.ToString(),args[i]);
}