|
|
导航: |
论坛 -> 移动应用开发
斑竹:flyers,iamdream |
|
作者: |
|
2012/6/17 19:33:37 |
标题: |
用IdHTTP怎么登录一个网站,我写的获取的都是乱码,请高手给看一下,谢谢! |
浏览:2297 |
|
加入我的收藏 |
楼主: |
Var
xmlstr,FileName: String; f: Textfile; xmlstr1:TStringList; RStream:TStringStream; begin xmlstr1:=TStringList.Create; xmlstr1.Add('<?xml version="1.0" encoding="UTF-8"?>'); xmlstr1.Add( '<root>'); xmlstr1.Add('<user>'); xmlstr1.Add('<operation>0010</operation>'); xmlstr1.Add('<userbm>10002</userbm>'); xmlstr1.Add('<username>常静</username>'); xmlstr1.Add('<password>123456</password>'); xmlstr1.Add('<dwbm>100</dwbm>'); xmlstr1.Add('</user>'); xmlstr1.Add('</root>'); RStream:=TStringStream.Create(''); //xmlstr1.Add(xmlstr); IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded'; //请求 IdHTTP1.Request.AcceptLanguage := 'zh-cn'; IdHTTP1.Post('http://119.187.133.10:9082/xnhyl/userLogin!firstLogin.action', xmlstr1,RStream); xmlstr:=IdHTTP1.Get('http://119.187.133.10:9082/xnhyl/userLogin!firstLogin.action'); RzMemo1.Lines.Add(xmlstr); RzMemo1.Text:=RStream.DataString;
此帖子包含附件:
大小:53.2K |
----------------------------------------------
- |
作者: |
kygl (kygl) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2012/6/17 22:12:56 |
1楼: |
将获取回来的内容utf8decode一下
----------------------------------------------
-
|
作者: |
star5 (星五) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2012/6/17 23:14:20 |
2楼: |
楼上正解,取到的是“新型农村合作医疗信息管理系统”
----------------------------------------------
博客 - http://offeu.com 脚本模型 - http://webpascal.com 需要短信接口的请联系我,可发行业与营销内容。
|
作者: |
|
2012/6/18 9:39:29 |
3楼: |
有例子吗?能给写一下看看吗?
----------------------------------------------
-
|
作者: |
star5 (星五) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2012/6/18 10:25:50 |
4楼: |
RzMemo1.Text:=utf8decode(RStream.DataString);
----------------------------------------------
博客 - http://offeu.com 脚本模型 - http://webpascal.com 需要短信接口的请联系我,可发行业与营销内容。
|
|