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 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
private declare function getwindowsdirectory lib "kernel32" alias "getwindowsdirectorya" (byval lpbuffer as string, byval nsize as long) as long
写ini文件(字符串)
public sub writeini(byval filename as string, byval app as string, byval key as string, byval strvalue as string)
dim result as long
result = writeprivateprofilestring(app, key, strvalue, filename)
end sub
读整型
public function getiniint(byval filename as string, byval app as string, byval key as string) as long
dim result as long
result = getprivateprofileint(app, key, 0, filename)
getiniint = result
end function
读字符串
public function getinistr(byval filename as string, byval app as string, byval key as string) as string
dim result as long
dim bufferstr as string * 255
result = getprivateprofilestring(app, key, "", bufferstr, len(bufferstr), filename)
if result = 0 then
getinistr = ""
else
getinistr = left(bufferstr, result)
end if
end function
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


