<%
'********************************************
'过程名称:mysubstr
'作    用:获取字符串中指定部分的字符串
'传入参数：	s 原字符串
'			sstart,字符串起始位置
'			sstop,字符串结束位置
'返回值：截取后的子串
'********************************************
Function mysubstr(s, sstart, sstop)
	Dim src,p1
	src = s
	p1 = instr(src, sstart)
	src = Mid(src, p1+Len(sstart), Len(src)-Len(sstart)-p1+1)
	p1 = instr(src, sstop)
	src = Mid(src, 1, p1-1)
	mysubstr = src
End Function
 '输出XML
     Function parseXML(params)
        Dim xmlContent
        xmlContent = "<xml>"
        keys = params.keys()
        For Each k In keys

                xmlContent = xmlContent & "<" & k & "><![CDATA[" & params(k) & "]]></" & k & ">"

        Next
        xmlContent = xmlContent & "</xml>"
        parseXML = xmlContent
    End Function

 



 Public Function createSHA1Sign(params)
        Dim signStr, sign, keys, i, j, tmp, k
        Dim signParams
        Set signParams = Server.CreateObject("Scripting.Dictionary") ' Server.CreateObject("Scripting.Dictionary")
    
        keys = params.keys()
        For Each k In keys
            signParams.Add k, params(k)
        Next
        keys = signParams.keys()
        '按字母顺序排序
        For i = 0 To UBound(keys) - 1
            For j = i + 1 To UBound(keys)
                If StrComp(keys(i), keys(j)) > 0 Then
                    tmp = keys(i)
                    keys(i) = keys(j)
                    keys(j) = tmp
                End If
            Next
        Next
        '组合签名字符串
        For Each k In keys
            If signStr = "" Then
                signStr = k & "=" & signParams(k)
            Else
                signStr = signStr & "&" & k & "=" & signParams(k)
            End If
        Next
        '生成签名
'        sign = md5(signStr)
   sign = signStr
        '设置debuginfo
'        debugInfo = debugInfo & "SHA1:" & signStr & " => appsign:" & sign & Chr(10)
        createSHA1Sign = sign
    End Function

%>