在C#中读取和写入ini文件的一段代码,其实本文只是指出一个方向,希望大家能够触类旁通。 以下为代码全文: //读ini文件(数字 ////////////////////////////////////////////////////////////// namespace EchonComponentLibrary [DllImport(“kernel32”)]
//写INI文件
[ DllImport ( “kernel32” ) ]
private static extern bool WritePrivateProfileString ( string section ,string key , string val , string filePath ) ;
//读ini文件(字符
[ DllImport ( “kernel32” ) ]
private static extern int GetPrivateProfileString ( string section ,string key , string def , StringBuilder retVal ,int size , string filePath ) ;
[ DllImport ( “kernel32” ) ]
private static extern int GetPrivateProfileInt 的( string section ,string key , int def , string filePath ) ;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
{
/// <summary>
/// IniFile 的摘要说明。
/// </summary>
public class IniFile
{
private string FFileName;
c#中如何读写ini文件_c#应用
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » c#中如何读写ini文件_c#应用
相关推荐
- 暂无文章
