Option Explicit
   'read
   Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" _
                 (ByVal lpApplicationName As String, _
                   ByVal lpKeyName As String, _
                   ByVal lpDefault As String, _
                   ByVal lpReturnedString As String, _
                   ByVal nSize As Long, _
                   ByVal lpFileName As String) As Long
   'write
   Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" _
                 (ByVal lpApplicationName As String, _
                   ByVal lpKeyName As String, _
                   ByVal lpString As String, _
                   ByVal lpFileName As String) As Long

Sub Read()
    Dim Rec As String
    Dim NC As Long
    
    Rec = String(255, 0)
    NC = GetPrivateProfileString("BOOT", "Shell", "", Rec, 255, "D:\test.ini")
    MsgBox Rec
    
End Sub

Sub WriteProfile()
    Dim NC As Long
    NC = WritePrivateProfileString("BOOT", "Shell", "Test1", "D:\test.ini")
End Sub

  

相关文章:

  • 2021-11-20
  • 2021-10-31
  • 2021-07-24
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-24
  • 2021-09-02
  • 2021-09-13
  • 2021-08-18
  • 2021-10-21
  • 2022-02-28
  • 2021-10-27
相关资源
相似解决方案