一个INI文件
[Gateway]
GatewayCount=1
GateWay1=Est;1;127.0.0.1;81;Async
要用VB作一个图形界面对[Gateway]进行添加,修改,删除并加以保存的操作
请各位达人高手帮帮忙
我是才入的,不知道给多少分合适,就按默认的算吧
如果不合适的话,请各位原谅
[Gateway]
GatewayCount=1
GateWay1=Est;1;127.0.0.1;81;Async
要用VB作一个图形界面对[Gateway]进行添加,修改,删除并加以保存的操作
请各位达人高手帮帮忙
我是才入的,不知道给多少分合适,就按默认的算吧
如果不合适的话,请各位原谅
没试过从程序中修改。
GZ
不过你说的是模块的函数声明吧?
说明一下小弟前天才开始学的VB
请各位高手说的详细明白一点。
这里谢谢啦!
'读取键值
Public Function GetINIString_Zhc(strINIFileName As String, strSection As String, strKey As String) As String
On Error GoTo ErrorHandle
Dim strTmp As String
strTmp = Space(3000)
If Trim$(strINIFileName) <> "" And Dir$(Trim$(strINIFileName)) <> "" And _
Trim$(strSection) <> "" And Trim$(strKey) <> "" Then
Dim tmp As Integer
If GetPrivateProfileString(strSection, strKey, "", strTmp, 3000, strINIFileName) > 0 Then
GetINIString_Zhc = TrimAPIString$(strTmp)
Else
GetINIString_Zhc = ""
End If
Else
GetINIString_Zhc = ""
End If
Exit Function
ErrorHandle:
GetINIString_Zhc = ""
MsgBox ERR.Description + " GetINIString_Zhc", vbCritical
End Function'写键值
Public Function SetINIString_Zhc(strINIFileName As String, strSection As String, strKey As String, strSetString As String) As Boolean
On Error GoTo ErrorHandle
Dim iWriteLen As Integer
If Trim$(strINIFileName) <> "" And _
Trim$(strSection) <> "" And Trim$(strKey) <> "" Then
iWriteLen = WritePrivateProfileString(strSection, strKey, Trim$(strSetString), strINIFileName)
If iWriteLen <> 0 Then
SetINIString_Zhc = True
Else
SetINIString_Zhc = False
End If
Else
SetINIString_Zhc = False
End If
Exit Function
ErrorHandle:
SetINIString_Zhc = False
MsgBox ERR.Description + " SetINIString_Zhc", vbCritical
Exit Function
End Function