Api in C#

  • Thread starter Thread starter Weimin Zhang
  • Start date Start date
W

Weimin Zhang

I would like to access my ini file from C#, but looks
like C# doesn't support the Api function,
GetPrivateProfileString() which I used to read from an
ini file in VS 6. Is there anyway to use this function,
or other ways to access an ini file from C#? Thanks.
 
Weimin Zhang said:
I would like to access my ini file from C#, but looks
like C# doesn't support the Api function,
GetPrivateProfileString() which I used to read from an
ini file in VS 6. Is there anyway to use this function,
or other ways to access an ini file from C#? Thanks.


Whilst Microsoft recommends using XML now - some of us still need to support
ini file for legacy reasons. You can use PInvoke and the Kernal.dll to gain
access to GetPrivateProfileString()
 
Weimin Zhang said:
I would like to access my ini file from C#, but looks
like C# doesn't support the Api function,
GetPrivateProfileString() which I used to read from an
ini file in VS 6. Is there anyway to use this function,
or other ways to access an ini file from C#? Thanks.

Take a look at http://www.mentalis.org/soft/class.qpx?id=6
It's a wrapper around the GetPrivatProfileString and
WritePrivateProfileString functions.

Regards,
Pieter Philippaerts
Managed SSL/TLS: http://www.mentalis.org/go.php?sl
 
Thanks.

The dll is called kernel32.dll.
-----Original Message-----




Whilst Microsoft recommends using XML now - some of us still need to support
ini file for legacy reasons. You can use PInvoke and the Kernal.dll to gain
access to GetPrivateProfileString()



.
 
Back
Top