脚 本 之 家 www.jb51.net
页面导航:  不限条件-->取
本地搜索:
reg=/<[img|href][^>]*src\s*=\s*('|")?([^'">]*)\1([^>])*>/ig...
http://www.jb51.net//article/16773.htm
[code]usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.IO;usingSystem.Text.RegularExpressions;namespaceTest{classFiEmail{publicstaticvoidMain(string[]args){Console.WriteLine("请输入内容路径:");string[]fs=Directory.GetFiles(args[0]);if(fs!=null){stringjobsPattern=@"([\w-]+(\.\w+)*@([...
http://www.jb51.net//article/16767.htm
Java获取URL内容的,我这里只给出GET方式的,POST和其它方式的都是比较类似的。其技术要点就一下三点。第一:创建HttpURLConnection第二:打开URL,创建一个InputStream第三:逐行(逐字节)读取,如果需要,转换编码,放入字符串。好,一下就开始代码吧:[code]publicStringgetUrlContent(Stringpath){Stringrtn="";intc;try{java.net.URLl_url=newjava.net.URL(path);java.net.HttpURLConnectionl_connection=(java.net.Http...
http://www.jb51.net//article/16762.htm
<?php$msn=newmyMSN("h058@test.com","123");//MSNv9classmyMSN{private$server="messenger.hotmail.com";private$port=1863;private$nexus="https://nexus.passport.com/rdr/pprdr.asp";private$sshLogin="login.live.com/login2.srf";//loginnet.passport.com/login2.srfprivate$getCode=null;private$_ip=null;privat...
http://www.jb51.net//article/16720.htm
抓取到的内容在通过正则表达式做一下过滤就得到了你想要的内容,至于如何用正则表达式过滤,在这里就不做介绍了,有兴趣的,以下就是几种常用的用php抓取网页中的内容的方法。1.file_get_contentsPHP代码[code]<?php$url="http://www.jb51.net";$contents=file_get_contents($url);//如果出现中文乱码使用下面代码//$getcontent=iconv("gb2312","utf-8",$contents);echo$contents;?>[/code]2.curlPHP代码[code]<?php$ur...
http://www.jb51.net//article/16718.htm
<%ForeachobjinRequest.Formresponse.write"<fontcolor=red>"&obj&"</font><br>"obj=Request.Form(obj)response.writeobj&"<br>"Next%><formname=formaction="1.asp"method="post"><inputtype=textname="ad"><br><br><inputtype=textname="sdf">&...
http://www.jb51.net//article/16691.htm
其实获得鼠标位置就是一句话的事情,但是要是不了解浏览器间的区别,整个过程就会让人很郁闷,区别在与:1.IE下获得x和y轴的距离分别用event.x和event.y;FF下获得x和y轴的距离分别用event.pageX和event.pageY;2.IE下用此方法获得的位置是不算滚动条滚过的位置的,即它只会算到浏览器边缘;FF则会算进滚过去的那些位置;(这个地方很让我崩溃,为这么点小区别我把所有用到的程序全部重写了一遍,囧死……)解决1的办法,无非是判断一下浏览器,然后用什么方式;解决2的办法,是在IE的情况下在x和y轴分别加上document.documentElement.scrollTop和...
http://www.jb51.net//article/16638.htm
为了完成以上的需求,我们就需要模拟浏览器浏览网页,得到页面的数据在进行分析,最后把分析的结构,即整理好的数据写入数据库。那么我们的思路就是:  1、发送HttpRequest请求。  2、接收HttpResponse返回的结果。得到特定页面的html源文件。  3、取出包含数据的那一部分源码。  4、根据html源码生成HtmlDocument,循环取出数据。  5、写入数据库。程序如下:  [code]//根据Url地址得到网页的html源码privatestringGetWebContent(stringUrl){stringstrResult="";try{HttpWebRequestr...
http://www.jb51.net//article/16618.htm
[code]/***截取字符串len为字节长度*@paramstr*@paramlen*@return*@throwsUnsupportedEncodingException*/publicstaticStringgetLimitLengthString(Stringstr,intlen){try{intcounterOfDoubleByte=0;byte[]b=str.getBytes("gb2312");if(b.length<=len)returnstr;for(inti=0;i<len;i++){if(b[i]<0)counterOfDoubleByte++;}if(...
http://www.jb51.net//article/16560.htm
[code]<?phpfunctiongetimageinfo(img){//img为图象文件绝对路径img_info=getimagesize(img);switch(img_info[2]){case1:imgtype="gif";break;case2:imgtype="jpg";break;case3:imgtype="png";break;}img_type=imgtype."图像";img_size=ceil(filesize(img)/1000)."k";//获取文件大小new_img_info=array("width"=>img_info[0],"height"=...
http://www.jb51.net//article/16541.htm
[code]usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Drawing;usingSystem.IO;usingSystem.Drawing.Imaging;namespaceEC{/...
http://www.jb51.net//article/16423.htm
共有:420/10,当前2/42页  [首页] [上一页] 1 2 3 4 5 6 7 8 [下一页]  [尾页] 转到: