Modini. Bas

Source: Internet
Author: User

Attribute vb_name = "Modini"
Option explicit

Private declare function getprivateprofilestring lib "Kernel32" alias "inline" (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
Private declare function writeprivateprofilestring lib "Kernel32" alias "writeprivateprofilestringa" (byval lpapplicationname as string, byval lpkeyname as any, byval lpstring as any, byval lpfilename as string) as long
Public inifilename as string
Function getinis (byval sectionname as string, byval keyword as string, optional byval defstring as string) as string
Dim resultstring as string * 144, TEMP %
Dim S $, I %
Temp % = getprivateprofilestring (sectionname, keyword, "", resultstring, 144, inifilename)

If TEMP %> 0 then
For 1 to 144
If ASC (mid $ (resultstring, I, 1) <> 0 then
S = S & Mid $ (resultstring, I, 1)
End if
Next
Else
Temp % = writeprivateprofilestring (sectionname, keyword, defstring, inifilename)
S = defstring
End if
Getinis = s
End Function

Public Function setinis (byval sectionname as string, byval keyword as string, byval valstr as string) as Boolean
Setinis = writeprivateprofilestring (sectionname, keyword, valstr, inifilename)
End Function

Public Function delinisec (byval sectionname as string) as Boolean
delinisec = writeprivateprofilestring (sectionname, 0 &, "", inifilename)
end function
'delkeyword
Public Function delinikey (byval sectionname as string, byval keyword as string) as Boolean
delinikey = writeprivateprofilestring (sectionname, keyword, 0 &, inifilename)
end function

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.