⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getprofilesection.bas

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 BAS
字号:
Attribute VB_Name = "GetProfileSectionModule"
Option Explicit

Declare Function GetProfileSection Lib "kernel32" Alias "GetProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long

Sub Main()
    Dim S As String, pos As Integer, count As Integer
    
    S = String(32767, 0)
    GetProfileSection "windows", S, Len(S)
    
    pos = InStr(S, Chr(0))
    While pos > 1
        count = count + 1
        MsgBox Left(S, pos - 1), , "GetProfileSection"
        S = Mid(S, pos + 1)
        pos = InStr(S, Chr(0))
    Wend
    MsgBox "[windows]含有 " & count & "个Key"
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -