28,406
社区成员
发帖
与我相关
我的任务
分享
Public Function GetIni1(ByVal strPrimary As String, ByVal strSubKey As String, ByVal strIniFilePath As String) As String
Dim myFso As FileSystemObject
Dim MyFile As TextStream
Dim intCount As Integer, strState As String
Set myFso = New FileSystemObject
Set MyFile = myFso.OpenTextFile(strIniFilePath, 1, False, False)
With MyFile
Do Until .AtEndOfStream
If intCount = 0 Then
If .ReadLine = "[" & strPrimary & "]" Then
intCount = 1
End If
Else
strState = .ReadLine
If UCase(Left(strState, Len(strSubKey & "="))) = UCase(strSubKey & "=") Then
GetIni1 = Right(strState, Len(strState) - Len(strSubKey & "="))
End If
End If
Loop
.Close
End With
Set MyFile = Nothing
Set myFso = Nothing
End Function
Public Sub OnStartPage(PassedscriptContext As ScriptingContext)
Set Context = PassedscriptContext
Set Application = Context.Application
Set Request = Context.Request
Set Response = Context.Response
Set Server = Context.Server
Set Session = Context.Session
End Sub
Public Sub showsuc()
Dim file
file = App.Path & "\config.ini"
Response.Write GetIni1("authorization", "code", file)
End Sub