获取windows身份认证网站页面内容
2016-09-13 09:39
387 查看
有些网站必须登录才能获取到页面内容。
代码如下,可获取数据。
获取数据得到 如下图
转载自:http://www.cnblogs.com/cyehu/p/5852599.html
代码如下,可获取数据。
var url = "https://yunda-api-test.appspot.com/int/parcel?wait=true"; var uid = "1@test"; var pwd = "97878"; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Method = "GET"; // Add authentication to request request.Credentials = new NetworkCredential(uid, pwd); var text = string.Empty; // Get response using (WebResponse response = request.GetResponse()) { // Get the response stream StreamReader reader = new StreamReader(response.GetResponseStream()); // Console application output text = reader.ReadToEnd(); } Console.WriteLine(text);
获取数据得到 如下图
转载自:http://www.cnblogs.com/cyehu/p/5852599.html
相关文章推荐
- 用.net实现远程获取其他网站页面内容!(核心代码分析)
- 用.net实现远程获取其他网站页面内容!(核心代码分析)
- Python手动构造Cookie模拟登录后获取网站页面内容
- 用.net实现远程获取其他网站页面内容
- 【.Net码农】用asp.net实现远程获取其他网站页面指定内容
- 借助jsoup实现从网站页面中获取指定内容
- (转)用.net实现远程获取其他网站页面内容!(核心代码分析)
- 用asp.net实现远程获取其他网站页面指定内容
- 用asp.net实现远程获取其他网站页面指定内容
- .net实现远程获取其他网站页面内容
- [转]用asp.net实现远程获取其他网站页面指定内容
- 用.net实现远程获取其他网站页面内容!(核心代码分析)
- 用.net实现远程获取其他网站页面内容
- php抓取网站内容,获取通达OA官网最新用户,判断页面是否能访问,php正则
- 用.net实现远程获取其他网站页面内容!(核心代码分析)
- 用.net实现远程获取其他网站页面内容!(核心代码分析)
- 用asp.net实现远程获取其他网站页面指定内容
- ASP.net C#获取其他网站的页面内容
- .net实现远程获取其他网站页面内容
- 用.net实现远程获取其他网站页面内容