摘要: 通过这个方法我们在调用远程服务之前进行下判断,给出友情提示,非常人性化。代码如下:privateboolUrlIsExist(Stringurl){System.Uriu=null;try{u=newUri(url);}catch{returnfalse;}boolisExist=false;System.Net.HttpWebRequestr=System.Net.HttpWebRequest.Create(u)asSystem.Net.HttpWebRequest;r.Method="HEAD";try{System.Net.HttpWebResponses=r.Get 阅读全文
posted @ 2011-11-22 23:57 龙仪 阅读(2580) 评论(0) 推荐(0) 编辑
摘要: 直接上代码:<%@PageLanguage="C#"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><scriptrunat="server">///<summary>///param1param2对应前面js传递来的参数。///</summary>///<paramn 阅读全文
posted @ 2011-11-22 23:54 龙仪 阅读(804) 评论(0) 推荐(0) 编辑
摘要: 工具方法:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.IO;usingSystem.Text.RegularExpressions;///<summary>///IPScanner的摘要说明///</summary>publicclassIPScanner{privatestringdataPath;privatestringip;privatestringcountry;privatestringlocal;privatelongfir 阅读全文
posted @ 2011-11-22 23:52 龙仪 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 利用.NET框架提供的 WebClient类 和 WebRequest类,我们可以很轻易地得到给定URL地址的源代码,很简单,以下是C#的完整的例子. GetPageHtml.aspx1<%@Pagelanguage="c#"validateRequest="false"Codebehind="GetPageHtml.aspx.cs"2AutoEventWireup="false"Inherits="eMeng.Exam.GetPageHtml"%>3<!DOCTYPEHTML 阅读全文
posted @ 2011-11-22 23:48 龙仪 阅读(238) 评论(0) 推荐(0) 编辑