中易网

asp如何获取另一页面的文本返回值?

答案:3  悬赏:10  
解决时间 2021-01-17 19:21
  • 提问者网友:世勋超人
  • 2021-01-16 20:02
asp如何获取另一页面的文本返回值?
最佳答案
  • 二级知识专家网友:雪起风沙痕
  • 2021-01-16 20:24
其实很简单
<% a=request("action")
if a="xxxx" then response.write "成功"
if a="zzz" then response.write "不成功"
%>
全部回答
  • 1楼网友:低音帝王
  • 2021-01-16 22:37
<%
dim inputinf
inputinf=request.QueryString("action")
if inputinf="yyy" then
response.write("操作成功")
else if inputinf="zzz" then
response.write("操作失败")
end if
%>
追问:get参数action是我传递给face.asp的内容
face.asp是一个接口,我无法修改face.asp的内容
我是要获取face.asp的执行结果,不是要这个参数
  • 2楼网友:北方的南先生
  • 2021-01-16 21:19
<%
'用于编码转换的函数
Function BytesToBstr(body,Cset)
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
'抓取网页内容的函数
Function getPageContent(Url)
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "Get", Url, False, "", ""
objXMLHTTP.Send
getPageContent = BytesToBstr(objXMLHTTP.ResponseBody,"GB2312")
Set objXMLHTTP = Nothing
End Function
'页面开始执行
Dim tempResult '保存返回值的变量
tempResult = getPageContent("http://localhost/face.asp?action=xxxx")
'--------上面URL中的localhost是我测试时用的,你得替换成自己的正确URL
If tempResult = "yyy" Then'判断返回值的内容
Response.write "操作成功"
Else
Response.write "操作失败"
End If
%>
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息