Advertisement
2002ASP Windows API Call/ Explanation #237

EZ - .ini

Access .ini files in the blink of an eye. Use one line of your input to quickly retrive .ini values. With the same one line of code write to your .ini file. If you have any improvements on this code, E-Mail me at "[email protected]".

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
Function mfncGetFromIni(strSectionHeader As String, strVariableName As String, strFileName As String) As String
  '**********************************************************************************************
  ' DESCRIPTION:Reads from an *.INI file strFileName (full path & file name)
  ' RETURNS:The string stored in [strSectionHeader], line beginning
  ' strVariableName=
'**********************************************************************************************
  ' Initialise variable
  Dim strReturn As String
  ' Blank the return string
  strReturn = String(255, Chr(0))
  'Get requested information, trimming the returned
  ' string
  mfncGetFromIni = Left$(strReturn, GetPrivateProfileString(strSectionHeader, ByVal strVariableName, "", strReturn, Len(strReturn), strFileName))
End Function
Function mfncWriteIni(strSectionHeader As String, strVariableName As String, strValue As String, strFileName As String) As Integer
  '*****************************************************************************************************
  ' DESCRIPTION:Writes to an *.INI file called strFileName (full  path & file name)
  ' RETURNS:Integer indicating failure (0) or success (other)  to write
    '*****************************************************************************************************
  mfncWriteIni = WritePrivateProfileString(strSectionHeader, strVariableName, strValue, strFileName)
End Function
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine