操作INI文件函数.bas
资源名称:vbmcrisrc.rar [点击查看]
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual Basic
- Attribute VB_Name = "操作INI文件函数"
- Option Explicit
- ' Download by http://www.codefans.net
- Public 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
- Public Function ReadINIFile(AppName As String, KeyName As String, FileName As String) As String
- Dim RetStr As String
- RetStr = String(255, Chr(0))
- ReadINIFile = Left(RetStr, GetPrivateProfileString(AppName, ByVal KeyName, "", RetStr, Len(RetStr), FileName))
- End Function