xp系统里没有还原设置:VB求助~INI调用的和DIM的效果不一样!有源码!
dim A as string
然后从INI里读取一个字符串存到 A
Dim daima as string
daima = inet1.openurl("http://www.7song.cn/special/2259.htm")
。。。。。。。。。。。。。。。。。。。
对不起有点不好形容了。。。
请下载源码看吧~
我的QQ:22441980
源码: http://www.byle.cn/help.rar
有专门的INI读写函数
Dim Ret As Long
Dim Start As Long
Public FileName As String
Const BufSize = 10240
Dim buf As String * BufSize
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) As Long
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 Long
Public Sub SetValue(ByVal clsName As String, ByVal key As String, ByVal V As String)
Ret = WritePrivateProfileString(clsName, key, V, FileName)
End Sub
Public Function GetValue(ByVal clsName As String, ByVal key As String) As String
Ret = GetPrivateProfileString(clsName, key, "", buf, BufSize, FileName)
Start = 1
GetValue = RetStr()
End Function
Private Function RetStr() As String
Dim i As Long
i = InStr(Start, buf, Chr(0))
If i > Start Then
RetStr = Mid(buf, Start, i - Start)
End If
Start = i + 1
End Function
获取后 有问题的要进行过滤
dim v as string
v=getValue("section","key")
v=replace(v,chr(0))
如果不行 应该是你的程序编写问题