[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://smsrebuild1.mail.10086.cn/sms/sms?func=sms:sendSms&sid=MTQ4ODE4ODI0NjAwMDE4ODYx04B360A1000001&rnd=0.37071827159031057&cguid=1737550619602",//URL 必需项
Method = "POST",//URL 可选项 默认为Get
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = "udata_account=861fb281-a272-4762-9c90-16ad93186281; fromhtml5=1; html5SkinPath7635=; _139_index_isSmsLogin=0; _139_login_version=25; RMKEY=80f9ebbc58b3f356; Os_SSo_Sid=MTQ4ODE4ODI0NjAwMDE4ODYx04B360A1000001; cookiepartid7635=12; cookiepartid=12; Login_UserNumber=13637931458; UserData=%7BssoSid%3A%27MTQ4ODE4ODI0NjAwMDE4ODYx04B360A1000001%27%2CuidList%3A%5B%221611596852%22%5D%2CprovCode%3A31%2CserviceItem%3A%270015%27%2ClastLoginDate%3A%272017-02-27+16%3A37%3A40%27%2CuserNumber%3A%278613637931458%27%2Cloginname%3A%2713637931458%27%2C%22out_qanotify%22%3Afalse%7D; SkinPath27635=; rmUin7635=2163862460; provCode7635=31; areaCode7635=3101; loginProcessFlag=; udata_ft_300008869018=1488188258709; isReadUserMTQ4ODE4ODI0NjAwMDE4ODYx04B360A1000001=0",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
Referer ="http://smsrebuild1.mail.10086.cn//proxy.htm",//来源URL 可选项
Allowautoredirect = False,//是否根据301跳转 可选项
AutoRedirectCookie = False,//是否自动处理Cookie 可选项
//CerPath = "d:\123.cer",//证书绝对路径 可选项不需要证书时可以不写这个参数
//Connectionlimit = 1024,//最大连接数 可选项 默认为1024
Postdata = "<object><int name="doubleMsg">0</int><int name="submitType">1</int><string name="smsContent">测试短信</string><string name="receiverNumber">8618XXXX</string><string name="comeFrom">104</string><int name="sendType">0</int><int name="smsType">1</int><int name="serialId">-1</int><int name="isShareSms">0</int><string name="sendTime"></string><string name="validImg"></string><int name="groupLength">50</int><int name="isSaveRecord">1</int><int name="smsIds"></int><array name="receiverList"></array></object>",//Post数据 可选项GET时不需要写
//ProxyIp = "192.168.1.105:2020",//代理服务器ID 可选项 不需要代理 时可以不设置这三个参数
//ProxyPwd = "123456",//代理服务器密码 可选项
//ProxyUserName = "administrator",//代理服务器账户名 可选项
ResultType = ResultType.String,//返回数据类型,是Byte还是String
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
|