LotusScript接收POST數據的方法。從IBM網站上淘到的


Sub Initialize
        Dim session As New NotesSession
        Dim note As NotesDocument
        Dim HTTP_Post As String

        Set note = session.DocumentContext
        'Gets POST information passed to server
        HTTP_Post = note.Request_Content(0)
End Sub
The sample function below when passed the name of a variable submitted by the POST command will return its value.
Function getParameter(st As String) As String
        Dim session As New NotesSession
        Dim note As NotesDocument
        Dim HTTP_Post As String
        Dim myArray As Variant
        Dim myVar As Variant

        getParameter = ""       
        Set note = session.DocumentContext
        HTTP_Post = note.Request_Content(0)

        If ( Instr(HTTP_Post,"=") <> 0 ) Then
                myArray = Split(HTTP_Post, "&")
                Forall x In myArray
                        If ( Instr(1, x, st, 5) <> 0 ) Then
                                If ( Instr(x, "=") <> 0 ) Then
                                        myVar = Split(x, "=")
                                        getParameter = Replace(myVar(1), "+", " ")
                                End If
                                Exit Function
                        End If
                End Forall
        End If
End Function

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com