PHP Code:
using System;
using System.Text;
using System.Runtime.InteropServices;

class 
INIFile
{
    [
DllImport("kernel32")]
    private static 
extern long WritePrivateProfileString(String SectionString KeyString ValueString FilePath);
    [
DllImport("kernel32")]
    private static 
extern Int32 GetPrivateProfileString(String SectionString KeyString DefinitionStringBuilder Return, Int32 SizeString FilePath);

    private 
String FilePath String.Empty;

    public 
INIFile(String FilePath)
    {
        
this.FilePath FilePath;
    }

    public 
String this[String Key]
    {
        
get
        
{
            return 
this["Default"Key];
        }
        
set
        
{
            
this["Default"Key] = value;
        }
    }

    public 
String this [String SectionString Key]
    {
        
get 
        
{
            
StringBuilder Temp = new StringBuilder(255);
            
GetPrivateProfileString(SectionKey""Temp255this.FilePath);
            return 
Temp.ToString();
        }
        
set
        
{
            
WritePrivateProfileString(SectionKeyvaluethis.FilePath);
        }
    }

You do not need to create/read/write anything! All you need to do is use the class, the ini file will create itself, update itself, and read itself on command.

Allows you to create and use ini setting files for configuration.

Example Usage;
PHP Code:
INIFile Temp = new INIFile("C:\\Test.ini");
Temp["width"] = 10
That will automatically create the ini, and update the ini data, readable at next program entrance.