All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
C#中如何读写INI文件_.net资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/6 10:25:48 Browse times: 343 Comment times: 0

C#中如何读写INI文件_.net资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

C#中如何读写INI文件_.net资料_编程技术-数科优化网

在C#中读取和写入ini文件的一段代码,其实本文只是指出一个方向,希望大家能够触类旁通。

  以下为代码全文:


  //写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 ) ;

  //读ini文件(数字
  [ 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;

  namespace EchonComponentLibrary
  {
  ///


  /// IniFile 的摘要说明。
  ///

  public class IniFile
  {
  private string FFileName;

  [DllImport("kernel32")]






There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.