VB载入INI或inf配置文件
VB6.0中怎么在本程序目录自动写如一个配置文件,INF的.就比如,程序一运行就在本目录生成mbk.inf
然后向里面写入
op=1
id=2
cdkey=3
user=123
然后再读取本配置文件,把里面的内容加到程序里面运行?
补充:就比如这是网络上一个QQ密保卡保护器的关键代码(部分):Private Function GetPassword(sPSWCode As String) As String
Dim a As Long, b As Long
Dim c As String, d As String
Dim sa As String, sb As String
Dim PSW As Variant
d = vbNullString
If Len(sPSWCode) >= 2 Then
c = UCase(Right(sPSWCode, 2))
sa = Left(c, 1)
sb = Right(c, 1)
If Asc(sa) >= 65 And Asc(sa) <= 74 Then
If Asc(sb) >= 48 And Asc(sb) <= 57 Then
a = Asc(sa) - 65
b = Asc(sb) - 48
PSW = Choose(b * 8 + a + 1, _
1, 11, 21, 31, 41, 51, 61, 71, _
2, 12, 22, 32, 42, 52, 62, 72, _
3, 13, 23, 33, 43, 53, 63, 73, _
4, 14, 24, 34, 44, 54, 64, 74, _
5, 15, 25, 35, 45, 55, 65, 75, _
6, 16, 26, 36, 46, 56, 66, 76, _
7, 17, 27, 37, 47, 57, 67, 77, _
8, 18, 28, 38, 48, 58, 68, 78, _
9, 19, 29, 39, 49, 59, 69, 79, _
10, 20, 30, 40, 50, 60, 70, 80)
'依次输入密保卡0-9行的数据(注意:原密保卡的0行在最下边)
d = Right("00" & PSW, 2)
End If
End If
Else
d = vbNullString
End If
GetPassword = d
End Function
我要把其中
1, 11, 21, 31, 41, 51, 61, 71, _
2, 12, 22, 32, 42, 52, 62, 72, _
3, 13, 23, 33, 43, 53, 63, 73, _
4, 14, 24, 34, 44, 54, 64, 74, _
5, 15, 25, 35, 45, 55, 65, 75, _
6, 16, 26, 36, 46, 56, 66, 76, _
7, 17, 27, 37, 47, 57, 67, 77, _
8, 18, 28, 38, 48, 58, 68, 78, _
9, 19, 29, 39, 49, 59, 69, 79, _
10, 20, 30, 40, 50, 60, 70, 80)
这段改为通过配置文件载入的,要怎么做?