|
-
Oct 31st, 2000, 07:43 PM
#1
Thread Starter
Lively Member
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpkeyname As Any, ByVal lsstring As Any, ByVal lplfilename As String) As Long
Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationname As String, ByVal lpkeyname As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpkeyname As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
all this crap here is for the reading and writing ini files.
what i need to know is how can you delete a piece of information from an ini file....could somebody help me please....
-KnIgHt
-icq 17743984
-
Oct 31st, 2000, 07:53 PM
#2
Code:
Call WritePrivateProfileString(strsection$, UCase$(strkey$), "", strfullpath$)
-
Oct 31st, 2000, 08:03 PM
#3
Thread Starter
Lively Member
this is still not helping
this is my module code
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpkeyname As Any, ByVal lsstring As Any, ByVal lplfilename As String) As Long
Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationname As String, ByVal lpkeyname As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpkeyname As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
ok....look at this code...
this is my main code to work with ini files
Option Explicit
Public IniFileName As String
Public appnames As String
Public keynames As String
Public strins As String
Public returned As String
Public Sub Getstring()
Dim ret As Long
Dim temp As String * 50
Dim lpAppName As String, lpkeyname As String, lpDefault As String, lpFileName As String
lpAppName = appnames
lpkeyname = keynames
lpDefault = IniFileName
lpFileName = IniFileName
ret = GetPrivateProfileString(lpAppName, lpkeyname, lpDefault, temp, Len(temp), lpFileName)
returned = temp
End Sub
Public Sub Storestring()
Dim lpAppName As String, lpFileName As String, lpkeyname As String, lpString As String
Dim ret As Long
lpAppName = appnames
lpkeyname = keynames
lpString = strins
lpFileName = IniFileName
ret = WritePrivateProfileString(lpAppName, lpkeyname, lpString, lpFileName)
End Sub
how do i make a procedure for something like a
Public Sub DeleteString()???
give me full details please
-knight
-
Oct 31st, 2000, 08:10 PM
#4
Ok. Sorry for not explaining. What it will do is delete the value. What you want, correct?
Code:
Call WritePrivateProfileString("My Section", "Key", "", "C:\MyINI.ini")
"" '<- erases key value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|