Paul M wrote:
Could anyone help me with a sample for GetPrivateProfileString or
GetProfileString function?
[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileString(
string lpAppName, string lpKeyName, string lpDefault, StringBuilder
lpReturnedString, uint nSize, string lpFileName);
See:
http://www.pinvoke.net/
Example:
<code>
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace GPPS
{
class Class1
{
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder(500);
uint res = GetPrivateProfileString("AppName", "KeyName", "", sb,
sb.Capacity, @"d:\temp\test.ini");
Console.WriteLine(sb.ToString());
}
[System.Runtime.InteropServices.DllImport("kernel32 .dll")]
static extern uint GetPrivateProfileString(
string lpAppName, string lpKeyName, string lpDefault, StringBuilder
lpReturnedString, int nSize, string lpFileName);
}
}
</code>
--
Greetings
Jochen
Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Do you need daily reports from your server ?
http://sourceforge.net/projects/srvreport/