опубликован 09-01-2001 14:43 MSK
Nate, kto es4o ne znaet ili kto es4o ne polu4il na mail ot Armena :)Declare Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long
Function GetINI(ByVal strItem As String, ByVal strKey As String, ByVal strFile As String) As String
Dim uname As String
Dim slength As Long
uname = Space(255)
If ((InStr(1, strItem, "[") <> 0) Or (InStr(1, strItem, "]") <> 0)) Then
strItem = Replace(strItem, "[", "&")
strItem = Replace(strItem, "]", "&")
End If
slength = GetPrivateProfileString(strItem, strKey, "", uname, 255, strFile)
uname = Left(uname, slength)
GetINI = uname
End Function
Function WriteINI(ByVal strItem As String, ByVal strKey As String, strVal As String, ByVal strFile As String)
Dim retval As Long
If ((InStr(1, strItem, "[") <> 0) Or (InStr(1, strItem, "]") <> 0)) Then
strItem = Replace(strItem, "[", "&")
strItem = Replace(strItem, "]", "&")
End If
retval = WritePrivateProfileString(strItem, strKey, strVal, strFile)
End Function