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

📄 writeprofilesection.bas

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 BAS
字号:
Attribute VB_Name = "WriteProfileSectionModule"
Option Explicit
'写Win.ini文件
Declare Function WriteProfileSection Lib "kernel32" Alias "WriteProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String) As Long

Sub Main()
    Dim S As String, Success As Boolean
    
    S = "Key1=Value1" & Chr(0) & _
        "Key2=Value2" & Chr(0) & _
        "Key3=Value3" & Chr(0) & Chr(0)
    Success = WriteProfileSection("ProfileTest", S)
    If Success Then
        MsgBox "写入成功!"
    Else
        MsgBox "写入失败!"
    End If
End Sub

⌨️ 快捷键说明

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