I do not know how to use the previous days I wrote the operation of the INI file com? I'll post the code.
Source: Internet
Author: User
This is VB code, create a new ActiveX DLL, and then change the project name and class name, and then enter the following content in the class.
'//////////////////////////////
' Chinese name: INI file operation class
' English name: Blood_ini Class
' Author: Blood
' Production time: 2002.2.8
' Version: 1.0
' All rights reserved Blood 2002-2003
'//////////////////////////////
' Declare the variable
Private strappname as String ' INI subsection name
Private strkeyname as String ' INI project name
Item value for Private strvaluestr as String ' ini
Private strFileName as String ' INI file name
' Declare the API for Operation INI file
Private Declare Function getprivateprofilestring Lib "kernel32" Alias "Getprivateprofilestringa" (ByVal Lpapplicationname As String, ByVal lpkeyname as any, ByVal Lpdefault as String, ByVal lpreturnedstring as String, ByVal NS Ize as Long, ByVal lpFileName as String) as Long
Private Declare Function writeprivateprofilestring Lib "kernel32" Alias "Writeprivateprofilestringa" (ByVal Lpapplicationname As String, ByVal lpkeyname as any, ByVal lpstring as String, ByVal lpFileName as String) as Long
'////////////////////
' Start defining functions
'////////////////////
' Define functions to write INI file
Public Function Writeini () as Long
' Write value to INI file via API
Writeini = WritePrivateProfileString (Strappname, Strkeyname, Strvaluestr, strFileName)
End Function
' Defines a function to read the INI file
Public Function Getini () as String
Const string_size = 255 ' Specify string length
Dim lnglength as Long ' defines the length that the API function returns
Dim Strdefault as String * string_size ' defines the default value that is returned when no specified item is found
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.