[DllImport("kernel32.dll")]
static extern uint GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, uint nSize, string lpFileName);
public static string GetItemValueFromIniFile(string initFileName, string groupName, string itemName)
{
StringBuilder strBuilder = new StringBuilder(500);
uint uRes = GetPrivateProfileString(groupName, itemName, "default", strBuilder, (uint)strBuilder.Capacity, initFileName);
return strBuilder.ToString();
}
=========================================================
if (string.Equals(GetItemValueFromIniFile(IniconfigFile, "GROUPTest", "IsOK"), "T"))
{
//--------------------
}
----------------------------------------------------------