Writing INI file : Native Windows Function : Windows C# Examples


C# Examples » Windows » Native Windows Function »

 

Writing INI file









    
using  System;
using  System.Runtime.InteropServices;
using  System.Text;

class  MainClass
{
        [DllImport("kernel32.dll",  EntryPoint  =  "WritePrivateProfileString")]
        private  static  extern  bool  WritePrivateProfileString(string  lpAppName,  string  lpKeyName,  string  lpString,  string  lpFileName);

        static  void  Main(string[]  args)
        {
                //  Write  a  new  value.
                WritePrivateProfileString("MySection",  "MyKey",  "New  Value",  "\\initest.ini");

        }

}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Windows
» Native Windows Function