按键利用WritePrivateProfileString写入ini?
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any,ByVal lpFileName As String) As LongPrivate Sub Form_Load()
Command2.Caption = "写 ini"
End Sub
Private Sub Command2_Click()
Dim F As String
Dim A As String
F = "\shen.ini"
A = txtServerIP
dl = WritePrivateProfileString("ini", "IP", A, F)
If dl <> 0 Then MsgBox "写 ini 文件成功"
End Sub
以上这段代码可生成
shen.ini
[ini]
IP=192.168.1.1
要是想生成
shen.ini
IP=192.168.1.1
Port=12000
Name=张
应该怎么编法??谢谢。。。。。。。。
[[it] 本帖最后由 mayong123 于 2008-11-7 23:17 编辑 [/it]]