Private Declare Writeini Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVallpKeyName As Any, ByVal lpString As String, ByVal lpFileName As String) As Long
Private Declare Getini Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVallpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileNameAs String) As Long
Private Sub Command1_Click() '写ini文件
Dim path As String
If Right(App.path, 1) <> "" Then
path = App.path + ""
End If
Writeini "introduce", "name", "xp", path & "ceshi.ini"
Writeini "introduce", "age", "21", path & "ceshi.ini"
Writeini "introduce", "sex", "man", path & "ceshi.ini"
End Sub
Private Sub Command2_Click() '读ini文件
Dim path As String
If Right(App.path, 1) <> "" Then
path = App.path + ""
End If
Dim buf As String
buf = String(256, Chr(0))
Getini "introduce", "name", "", buf, 256, path & "ceshi.ini"
MsgBox buf
Getini "introduce", "age", "", buf, 256, path & "ceshi.ini"
MsgBox buf
Getini "introduce", "sex", "", buf, 256, path & "ceshi.ini"
MsgBox buf
End Sub
Ini文件的操作
[日志分享]
[日志信息]
该日志于 2009-02-25 15:53 由 redice 发表在 redice's Blog ,你除了可以发表评论外,还可以转载 “Ini文件的操作” 日志到你的网站或博客,但是请保留源地址及作者信息,谢谢!! (尊重他人劳动,你我共同努力)
呵呵,谢谢
VaTG790i.最好的<a href=http://www.kyfei.com>网站推广软件</a>,
非常好
....................
;ui;普i;uighur;ui;ui;个
在unix网络编程中看到了关于TCP/IP的一些内容,我感觉还是写的不够。正在下载中,一定
下载地址呢