模拟登陆

发布时间:2022-11-23 14:13:33   来源:文档文库   
字号:
httpwebrequest模拟登录获取cookies2个类,一个基类,一个构建头信息调用类关于如何获取到post中的内容,你之需要用http抓包工具把你与目标网站的请求信息抓下来,打开分析下按照抓下来的包中的数据进行构建就行了usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Net;usingSystem.IO;namespacebot{publicclassHtml{//////httpwebrequest类中的一些属性的集合///publicstructRequestPPT{privatestringstrAccept;//////获取或设置request类中的Accept属性///用以设置接受的文件类型///publicstringAccept{get{returnstrAccept;}set{strAccept=value;}}privatestringstrContentType;//////获取或设置request类中的ContentType属性///用以设置请求的媒体类型///
publicstringContentType{get{returnstrContentType;}set{strContentType=value;}}//////获取或设置request类中的UserAgent属性///用以设置请求的客户端信息///privatestringstrUserAgent;publicstringUserAgent{get{returnstrUserAgent;}set{strUserAgent=value;}}privatestringstrMethod;//////获取或设置request类中的Method属性///可以将Method属性设置为任何HTTP1.1协议谓词:GETHEADPOSTPUTDELETETRACEOPTIONS///如果ContentLength属性被设置为-1以外的任何值,则必须将Method属性设置为上载数据的协议属性。///publicstringMethod{get{returnstrMethod;}set{strMethod=value;

本文来源:https://www.2haoxitong.net/k/doc/1a676de8f8c75fbfc77db284.html

《模拟登陆.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式