用API吧.
/////读一整数/
[DllImport("kernel32.dll")]
private static extern int  GetPrivateProfileInt
( string lpAppName , string lpKey, int nDef, string lpFile) ; //读一字串
[DllImport("kernel32.dll")]
private static extern int GetPrivateProfileString
(string lpAppName,string lpKey,string lpDef ,System.Text.StringBuilder lpReturnString , int nSize,string lpFile); //写一字串
[DllImport("kernel32.dll")]
private static extern int WritePrivateProfileString (string lpAppName,string lpKey ,string lpAny,string lpFile);