Advertisement
2002ASP Files/ File Controls/ Input/ Output #1748

INI Read and INI Write - Simple and Error Free

INI Read and INI Write made simple. I included examples in each function. If you like my codes, then please vote for me. But only if you like them. Thanks =)

AI

AI Summary: 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.

Source Code
original-source
Public Function INIRead(iAppName As String, iKeyName As String, iFileName As String) As String
'Example:
  'x = INIRead("boot", "shell", "C:\WINDOWS\system.ini")
  Dim iStr As String
  iStr = String(255, Chr(0))
  INIRead = Left(iStr, GetPrivateProfileString(iAppName, ByVal iKeyName, "", iStr, Len(iStr), iFileName))
End Function
Public Function INIWrite(iAppName As String, iKeyName As String, iKeyString As String, iFileName As String)
'Example:
  'x = INIWrite("boot", "shell", "Explorer.exe", "C:\WINDOWS\system.ini")
r% = WritePrivateProfileString(iAppName, iKeyName, iKeyString, iFileName)
End Function
Original Comments (3)
Recovered from Wayback Machine