WritePrivateProfileString in NET framework 2.0

T

Thanh-Nhan Le

Hi,

Is there any way to use the API function WritePrivateProfileString in NET
framework 2.0?

Thanks
Nhan
 
M

Mark Rae [MVP]

Is there any way to use the API function WritePrivateProfileString in NET
framework 2.0?

Yes - same as any other API function i.e. via p/invoke:
http://www.pinvoke.net/default.aspx/kernel32/WritePrivateProfileString.html


[DllImport("kernel32.dll")]
static extern bool WritePrivateProfileString(string lpAppName, string
lpKeyName, string lpString, string lpFileName);

bool blnReturn = WritePrivateProfileString("AppName", "KeyName", "Value",
"FileName")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top