想用xmlhttp写个自动登录
网上的例子太少了
小白求指教,感谢。
function HTTPPOST1(const url: ansistring): ansistring;
var
r: OleVariant;
s: ansistring;
ceshi:string;
var
xmlHttp: OleVariant;
begin
url:='https://auth.eve-online.com.cn/oauth/authorize?client_id=eveclient&scope=eveClientLogin&response_type=token&redirect_uri=https%3A%2F%2Fauth.eve-online.com.cn%2Flauncher%3Fclient_id%3Deveclient';
ceshi:='Username=123456&Password=123456'';
xmlHttp := CreateOleObject('MSXML2.XMLHTTP');
try
xmlHttp.open('POST',url,false);
xmlHttp.setRequestHeader('Content-Length', IntToStr(Length(ceshi)));
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlHttp.send(ceshi);
Result:=xmlHttp.ResponseText;
finally
xmlHttp:=Unassigned;
end;
end;
网上的例子太少了
小白求指教,感谢。
function HTTPPOST1(const url: ansistring): ansistring;
var
r: OleVariant;
s: ansistring;
ceshi:string;
var
xmlHttp: OleVariant;
begin
url:='https://auth.eve-online.com.cn/oauth/authorize?client_id=eveclient&scope=eveClientLogin&response_type=token&redirect_uri=https%3A%2F%2Fauth.eve-online.com.cn%2Flauncher%3Fclient_id%3Deveclient';
ceshi:='Username=123456&Password=123456'';
xmlHttp := CreateOleObject('MSXML2.XMLHTTP');
try
xmlHttp.open('POST',url,false);
xmlHttp.setRequestHeader('Content-Length', IntToStr(Length(ceshi)));
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlHttp.send(ceshi);
Result:=xmlHttp.ResponseText;
finally
xmlHttp:=Unassigned;
end;
end;
解决方案 »
- 关于Access 双精度数据类型小数点位数保留问题!!!!~~~
- 请问各位高手:StringGrid组件是如何实现的,实现的原理是什么?
- XSLT转换的时候修改XSLT内部变量问题?(W3C标准)
- ADO加ORACLE的问题,我在向数据库中插入N条记录后,在数据库中显示的前两条记录跑到最后,而且其他的顺序有些也变了?
- 一个有关wm_DeviceChange中的Wparam和Lparam的问题,是否可以这样用解决RegisterDeviceNotification
- RICHEDIT保存成文本文件的问题?
- 用Basic开发OpenGL !
- 什么样的原因会导致程序突然消失不见?
- 各位大虾,能介绍几本delphi的书吗???
- sql语句的写法?
- adoquert dbgrid dbedit绑定问题,什么时候会自动保存到数据库
- SQL Image 二进制流转换问题
xmlHttp.send(ceshi);
这里不用变量。直接写入数据
xmlHttp.send('Username=123456&Password=123456');