资源简介
通过Http请求,对网站进行数据抓取,以及操控

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using System.Web;
namespace DnspodApp
{
public class DnspodHelp
{
string cookie = ““;
HttpHelper hh = new HttpHelper();
public bool Login(string username string pwd)
{
username.Replace(“@“ “%40“);
HttpItem hitem = new HttpItem
{
Method = “POST“
URL = “https://www.dnspod.cn/Auth/Login“
ContentType = “application/x-www-form-urlencoded“
Postdata = string.Format(“email={0}&password={1}&multilogin=f“ username pwd)
};
var r = hh.GetHtml(hitem);
cookie = r.Cookie;
if (r.Html.IndexOf(“success“) == -1)
{
return false;
}
else
{
return true;
}
}
public bool AddDomain(string domain)
{
var r = hh.GetHtml(new HttpItem
{
Method = “POST“
URL = “https://www.dnspod.cn/Api/Domain.Create“
ContentType = “application/x-www-form-urlencoded“
Postdata = string.Format(“format=json&lang=cn&error_on_empty=no&use_session=yes&domain={0}&group_id=1&is_mark=no“ domain)
Cookie = cookie
});
if (r.Html.IndexOf(“code\“:\“1\““) != -1)
{
return true;
}
else
{
return false;
}
}
public string GetDomainID(string domain)
{
var r = hh.GetHtml(new HttpItem
{
Method = “POST“
URL = “https://www.dnspod.cn/Api/Domain.Info“
ContentType = “application/x-www-form-urlencoded“
Postdata = string.Format(“domain={0}&format=json&lang=cn&error_on_empty=no“ domain)
Cookie = cookie
});
var firstIndex = r.Html.IndexOf(“domain\“:{\“id\“:\““);
if (firstIndex == -1)
{
return “-1“;
}
var templ = “domain\“:{\“id\“:\““.Length;
var re = r.Html.Substring(firstIndex + templ r.Html.IndexOf(“\““ firstIndex) - firstIndex - templ);
return re;
}
public bool AddRecord(string domainid string domain string record_type string value string sub_domain)
{
sub_domain = HttpUtility.UrlEncode(sub_domain);
var r = hh.GetHtml(new HttpItem
{
Method = “POST“
URL = “https://www.dnspod.cn/Api/Record.Create“
ContentType = “application/x-www-form-urlencoded“
Postdata = string.Format(“domain_id={0}&domain_g
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\app.config
文件 48128 2014-08-22 11:17 DnspodApp\DnspodApp\bin\Debug\DnspodApp.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\Debug\DnspodApp.exe.config
文件 77312 2014-08-22 11:17 DnspodApp\DnspodApp\bin\Debug\DnspodApp.pdb
文件 11600 2014-08-27 17:19 DnspodApp\DnspodApp\bin\Debug\DnspodApp.vshost.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\Debug\DnspodApp.vshost.exe.config
文件 490 2010-03-17 22:39 DnspodApp\DnspodApp\bin\Debug\DnspodApp.vshost.exe.manifest
文件 335360 2014-08-22 11:17 DnspodApp\DnspodApp\bin\Debug\Newtonsoft.Json.dll
文件 46080 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.exe.config
文件 69120 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.pdb
文件 11600 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.vshost.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.vshost.exe.config
文件 490 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\DnspodApp.vshost.exe.manifest
文件 335360 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加\Newtonsoft.Json.dll
文件 156617 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加.rar
文件 48128 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.exe.config
文件 69120 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.pdb
文件 11600 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.vshost.exe
文件 144 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.vshost.exe.config
文件 490 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\DnspodApp.vshost.exe.manifest
文件 335360 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版\Newtonsoft.Json.dll
文件 157560 2014-08-22 11:17 DnspodApp\DnspodApp\bin\域名添加12-21过期-简化版.rar
文件 4437 2014-08-22 11:17 DnspodApp\DnspodApp\DnspodApp.csproj
文件 6507 2014-08-26 08:46 DnspodApp\DnspodApp\DnspodHelp.cs
文件 13046 2014-08-22 11:17 DnspodApp\DnspodApp\Form1.cs
文件 14261 2014-08-22 11:17 DnspodApp\DnspodApp\Form1.Designer.cs
文件 5817 2014-08-22 11:17 DnspodApp\DnspodApp\Form1.resx
文件 11292 2014-08-22 14:10 DnspodApp\DnspodApp\Form2.cs
............此处省略37个文件信息
- 上一篇:多窗口应用程序(C#源代码编写)
- 下一篇:MyIE_V1.0_最终版源代码
相关资源
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
评论
共有 条评论