标题:[求教]关于vf通过api提交表单
只看楼主
sone92
Rank: 1
等 级:新手上路
帖 子:5
专家分:4
注 册:2009-11-12
结帖率:50%
 问题点数:0 回复次数:0 
[求教]关于vf通过api提交表单
我的代码如下:
declare Integer InternetOpen in WinINet.dll string,integer,string,string,integer
DECLARE INTEGER InternetConnect IN wininet.dll INTEGER,STRING,INTEGER,STRING,STRING,INTEGER,INTEGER,INTEGER
declare integer HttpOpenRequest in wininet.Dll integer,string,string,string,string,string,integer,integer
declare HttpSendRequest in wininet.dll integer,string,integer,string,integer
declare InternetCloseHandle in wininet.dll integer
c=null
a=InternetOpen("VFP",1,c,c,0)

b=InternetConnect(a,"202.202.96.53",80,c,c,3,0,0)

e=HttpOpenRequest(b,"post","/login/login1.jsp","http1.1","","*/*",0,1)

post_data="username=xxxx&if_login=Y&password=xxxx"

x=len("username=xxxx&if_login=Y&password=xxxx")

d=HttpSendRequest(e,"",0,post_data,x)

InternetCloseHandle(a)
InternetCloseHandle(b)
InternetCloseHandle(e)

即,我想用用户名xxxx,密码xxxx登陆到服务器
其对应的HTTP请求应该是
post /login/login1.jsp http1.1
host:202.202.96.53
content-type:*/*
username=xxxx&password=xxxx&if_login=Y

但是却实现不了,请问有哪位大哥知道问题在哪儿吗,帮我改改,先谢谢了!
搜索更多相关主题的帖子: 表单 api 
2009-11-19 19:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-292894-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.371936 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved