摘要
WEB应用经常需要用户登录才能进行操作,这要求必须先是其已注册用户。但有些情况下希望的用户只限于某个第三方网站已有的合法用户。如果第三方网站提供用户数据库或者诸如WEBService类接口,非常容易实现,否则就需要新的解决办法。HttpClient是一个开源的组件,实现了完整的WEB客户端编程能力,可以通过HttpClient模拟用户向第三方网站提交用户名密码等验证信息,然后根据返回的登录结果页面内容中是否包含相关的关键字来判断用户是否合法。
WEB applications often require a user to log in order to operate,so that this user must be registered before.But in some cases the user should be a legitimate user of a third-party websites.If the third party website to provide database or interfaces such as WebService class,it is easy to implement,otherwise new solutions should be resolved.HttpClient is an open-source components to achieve a complete Web client-side programming capabilities,user name,passwords and other authentication information is submitted through the HttpClient simulation users to third-party websites,and then return results of the login page content words to determine whether the user is legitimate.
出处
《电脑知识与技术》
2012年第4X期2779-2780,共2页
Computer Knowledge and Technology