我想做个小工具 就是在我软件中输入用户名和密码就可以登录到该网站上
该网站的网址是 http://211.147.222.40:8686/SMSPortal/

该网站的源代码是
<html>
<head>
<title>短信管理</title>
</head>
<body text="black" link="green" vlink="green" background="image/bk.gif" onload="document.form1.name.focus()">
<center> 
<form action="manager" method="post" name="form1">
<table border="0" align="center" bordercolor="#000000">
<tr><td><img src="image/banner.gif"></td></tr>
<tr><td><div align="center"><strong><font color="#000000">用户:</font></strong><input name="name" type="text" size="20" maxlength="20"></div></td></tr>
<tr><td><div align="center"><strong><font color="#000000">密码:</font></strong><input name="pwd" type="password" size="20" maxlength="20"></div></td></tr>
<tr><td><div align="center"><strong><input type="submit" value="登录">&nbsp;&nbsp;<input type="reset" value="取消"></strong></div></td></tr>
</table>
</form>
</center>
</body>
</html>高手帮忙 很急

解决方案 »

  1.   

    看了半天也没有搞明白究竟想问什么问题!
    如果仅仅是为了处理这个登录网页,你完全可以使用IdHttp控件封装一个数据包发到这个网址上进行登录,当然之后的所有操作都需要用IdHttp来进行封包解包处理;或者直接内嵌一个WebBrowser控件来自己构建一个简易浏览器;
      

  2.   

    放一个idhttp控件
    var
       postList:TStrings;
       htmltext:ansistring;
    begin
    postList:=TStringList.Create;
    postList.Add('name='+edit1.text);  //edit1为用户名
    postList.Add('pwd='+edit2.text);   //edit2为密码
    try
       with IdHTTP1 do
          begin
          Host:='211.147.222.40:8686';
          get('http://211.147.222.40:8686/SMSPortal/');
          //   Request.Referer:='http://211.147.222.40:8686/SMSPortal/';
          htmltext:=Post('/SMSPortal/manager',postList);
          end;
    finally
       postList.free;
       end;
    showmessage(htmltext);
    end;
      

  3.   

    to skylkj 你的代码运行不起来啊 我是在delphi2006上运行的 , Host:='211.147.222.40:8686';这句话有错误我把这句话注释起来后运行,可以运行 ,但无法登陆。你能否帮我再看下
      

  4.   

    非常感谢skylkj  现在可以运行了也可以登陆了 登陆后 需要点击网页中的某个按扭来查询我想要的数据 请问如何用delphi实现点某个按扭,以及获取里面的表单数据  谢谢
      

  5.   

    你下个Visual Sniffer
    每次执行什么就用Visual Sniffer截获下发送的消息,然后用idhttp照着发就行了我都是这么做的
      

  6.   

    登陆后的代码是<html>
    <head>
    <title>短信管理</title>
    </head>
    <frameset rows="10%,90%" framespacing="0"><frame src="logo.jsp" name="logo"><frameset cols="15%,85%" framespacing="0"><frame src="menu.jsp"><frame src="welcome.jsp" name="manager"></frameset></frameset>
    </html>其中的的查询是点name=“logo”然后就跑出一个表格 请问我该如何用dilphi实现点这个logo以及如何获取表格的数据呢  谢谢
      

  7.   

    Visual Sniffer这个工具可以在网上下载到运行后,你点击"开始拦截",之后你用浏览器进行你要做的操作,操作完后"停止拦截".这样可以拦截到你之前操作所对应的所有tcp请求,比如get,post等等,然后你用idhttp对应的方法做就可以了.我没法登陆,所以也不清楚具体情况
    你试试在之前的代码后面继续加上:
    postList.clear;
    postList.Add('name=logo');
    try
       htmltext:=IdHTTP1.Post('/welcome.jsp',postList);
    finally
       postList.free;
       end;
    showmessage(htmltext);
    end;
    如果你用Visual Sniffer的话可以很直观的看出需要post什么内容