您好,欢迎光临本网站![请登录][注册会员]  

搜索资源列表

  1. C#判断网站是否能访问或者断链的方法

  2. 本文实例讲述了C#判断网站是否能访问或者断链的方法。分享给大家供大家参考。具体如下: 最近有位朋友说他有很多网址,可能有些已经过期或者不能访问了。自己去一个一个点可以,但又很麻烦! 再过一段时间又要去检查一次,每次都这样就不方便了! 于是就做了个小程序给帮他检测一下。 以下做了一个例子作为参考: using System.Net; public bool CheckUrlVisit(string url) { try { HttpWebRequest req = (HttpWeb
  3. 所属分类:其它

    • 发布日期:2021-01-01
    • 文件大小:36864
    • 提供者:weixin_38702844
  1. C#同步、异步远程下载文件实例

  2. 1、使用HttpWebRequest/HttpWebResonse和WebClient 代码如下:HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); if (!response.ContentType.ToLower().StartsWi
  3. 所属分类:其它

    • 发布日期:2021-01-01
    • 文件大小:48128
    • 提供者:weixin_38608873
  1. 使用C#正则表达式获取必应每日图片地址

  2. 微软的Bing搜索引擎首页每天都会提供了一些有趣的图片,下面使用正则表达式获取图片的地址,不管是在手机app还是在网站上都是很好的图片素材,而且每天更新,非常不错。     首先访问微软的API,该地址返回的是xml文本,获取xml文本后使用正则表达式匹配url节点中的内容,加上必应主页链接即可获得图片的真实网址。下面是获取网址的全部代码。 string InfoUrl = http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1; HttpWebReq
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:44032
    • 提供者:weixin_38660069
  1. 实例详解C#实现http不同方法的请求

  2. 1、不带参数的POST请求 public static string Post(string url) { string result = ; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = POST; HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); Stream stream = resp.GetResp
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:35840
    • 提供者:weixin_38530202
  1. 动态webservice调用接口并读取解析返回结果

  2. 这里给大家带来的是动态webservice调用接口并读取解析返回结果的具体示例,非常的简单,注释也很详细,小伙伴们可以参考下。 using System; using System.Collections; using System.IO; using System.Net; using System.Text; using System.Xml; using System.Xml.Serialization; namespace Hishop.Plugins { /// /// 利
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:49152
    • 提供者:weixin_38626943
  1. C#远程获取图片文件流的方法

  2. 本文实例讲述了C#远程获取图片文件流的方法。分享给大家供大家参考,具体如下: protected void Page_Load(object sender, EventArgs e) { WebRequest myrequest = WebRequest.Create(http://huoche.7234.cn/images/jb51/ceaqyoj3xbb.jpg); WebResponse myresponse = myrequest.GetResponse(); Stream
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:34816
    • 提供者:weixin_38686924
  1. C#实现发送简单HTTP请求的方法

  2. 本文实例讲述了C#实现发送简单HTTP请求的方法。分享给大家供大家参考。具体如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO; namespace WRApp { class Program { static void Main(string[] args) { WebReques
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:30720
    • 提供者:weixin_38663973
  1. C#调用新浪微博API实例代码

  2. C#调用新浪微博API WebRequest wq = WebRequest.Create(this.address); HttpWebRequest hq = wq as HttpWebRequest; string username = keguangqiang163.com; string password = 3216731ks; string appkey = 5786724301; System.Net.CredentialCache cache = new CredentialC
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:48128
    • 提供者:weixin_38587473
  1. 在WinForm中发送HTTP请求的实现方法

  2. 如何在WinForm中请求发送HTTP 手工发送HTTP请求主要是调用 System.Net的HttpWebResponse方法 手工发送HTTP的GET请求: string strURL = http://localhost/Play/CH1/Service1.asmx/doSearch?keyword=; strURL +=this.textBox1.Text; System.Net.HttpWebRequest request; // 创建一个HTTP请求 request = (Syst
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:32768
    • 提供者:weixin_38532629
  1. C#根据http和ftp图片地址获取对应图片

  2. 本文实例为大家分享了C#根据http和ftp地址获取对应图片的具体代码,供大家参考,具体内容如下 public class GetBitmapImageClass { public BitmapSource GetImageHttp(string url,int width) { var image = new BitmapImage(); int BytesToRead = 100; if (!string.IsNullOrEmpty(url)) {
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:35840
    • 提供者:weixin_38653385
  1. C#实现下载网页HTML源码的方法

  2. 本文实例讲述了C#实现下载网页HTML源码的方法。分享给大家供大家参考之用。具体方法如下: public static class DownLoad_HTML { private static int FailCount = 0; //记录下载失败的次数 public static string GetHtml(string url) //传入要下载的网址 { string str = string.Empty; try { System.Net.WebRequest request = Sy
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:40960
    • 提供者:weixin_38642864
  1. c#实现网站监控查看是否正常示例

  2. 代码如下: 代码如下:public void MonitorWeb(Model.ServiceInfo mServerInfo)         {             var sUrl = mServerInfo.ServiceConfig;             var mLogInfo = new Model.LogInfo { ServiceId = mServerInfo.ServiceId };             try             {           
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:30720
    • 提供者:weixin_38732463
  1. C#获取网页源代码的方法

  2. 本文实例讲述了C#获取网页源代码的方法。分享给大家供大家参考。具体如下: public string GetPageHTML(string url) { try { HttpWebRequest wr = WebRequest.Create(url) as HttpWebRequest; wr.Method = get; wr.Accept = */*; wr.Headers.Add(Accept-Language: zh-cn); wr.Headers.Add(UA-
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:34816
    • 提供者:weixin_38592420
  1. C# 常用公共方法

  2. C# 常用公共方法,具体内容如下 1.后台调用weburl string hostUrl = http://www.a.com?id=123 ; HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(hostUrl); myReq.Method = GET; HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse(); Stream myStream = Http
  3. 所属分类:其它

    • 发布日期:2020-12-31
    • 文件大小:139264
    • 提供者:weixin_38621897
  1. C#动态webservice调用接口

  2. C#动态webservice调用接口 using System; using System.Collections; using System.IO; using System.Net; using System.Text; using System.Xml; using System.Xml.Serialization; namespace Hishop.Plugins { /// /// 利用WebRequest/WebResponse进行WebService调用的类 ///
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:78848
    • 提供者:weixin_38657139
  1. Winform实现抓取web页面内容的方法

  2. 本文以一个非常简单的实例讲述了Winform实现抓取web页面内容的方法,代码简洁易懂,非常实用!分享给大家供大家参考。 具体实现代码如下: WebRequest request = WebRequest.Create("http://1.bjapp.sinaapp.com/play.php?a=" + PageUrl); WebResponse response = request.GetResponse(); Stream resStream = response.GetResponseS
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:34816
    • 提供者:weixin_38667207
  1. C#实现简单的Http请求实例

  2. 本文实例讲述了C#实现简单的Http请求的方法。分享给大家供大家参考。具体分析如下: 通过.Net中的两个类HttpWebRequest类,HttpWebResponse类来实现Http的请求,响应处理。 第一个小测试是请求百度首页(http://www.baidu.com)的内容,也就是要获得百度首页的html内容, 实现步骤: 1.通过WebRequest类创建一个HttpWebRequest的对象,该对象可以包含Http请求信息。 (这里有点供大家思考:为什么要通过父类WebRequest
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:68608
    • 提供者:weixin_38691641
  1. C#使用HttpWebRequest重定向方法详解

  2. C# 如何使用 HttpWebRequest 重定向 1、 HttpWebRequest是c#中的网络交互组件 存在与system.net 命名空间中 打开vs2017 新建一个项目 文件-新建-项目 创建一个控制台应用程序 使用HttpWebRequest,使用之前要先创建 HttpWebRequest myReq =(HttpWebRequest)WebRequest.Create(“”); 发现并不识别HttpWebRequest 需要引用system.net命名空间 接下来
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:1048576
    • 提供者:weixin_38696336
  1. C#.Net基于正则表达式抓取百度百家文章列表的方法示例

  2. 本文实例讲述了C#.Net基于正则表达式抓取百度百家文章列表的方法。分享给大家供大家参考,具体如下: 工作之余,学习了一下正则表达式,鉴于实践是检验真理的唯一标准,于是便写了一个利用正则表达式抓取百度百家文章的例子,具体过程请看下面源码: 一、获取百度百家网页内容 public List GetUrl() { try { string url = "http://baijia.baidu.com/"; WebRequest webRequest = WebRequest
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:49152
    • 提供者:weixin_38571104
  1. C#下载网页并在控制台输出的方法

  2. 本文实例讲述了C#下载网页并在控制台输出的方法。分享给大家供大家参考。具体实现方法如下: using System; using System.Net; using System.Text; using System.IO; namespace Test { class GetWebPage { public static void Main(string[] args) { for(int i=0;ilt;args.Length;i++) { HttpWebRequest
  3. 所属分类:其它

    • 发布日期:2020-12-26
    • 文件大小:28672
    • 提供者:weixin_38551059
« 1 2 3 4 5 6 7 89 10 »