ÈçºÎ×¥È¡ÍøÒ³Êý¾Ý¡¢·ÖÎö²¢ÇÒÈ¥³ýHtml±êÇ©(C#)
<@Aattention Content="±¾BlogÔ´´ÎÄÕ£¬×ªÔØ»òÒýÓÃÇë×¢Ã÷×ªÔØ"
from="Robby.cnblogs.com"@>
ÓÉÓÚ×Ô¼ºµÄËÑË÷ÒýÇæÖÐ×öµ½ÁËÕâÒ»¿éÄÚÈÝ£¬ËùÒÔ½ñÌì˵˵ÈçºÎ×¥È¡ÍøÒ³Êý¾Ý¡¢·ÖÎö²¢ÇÒÈ¥³ýHtml±êÇ©£¬¸ø´ó¼ÒÌṩһ¸ö²Î¿¼¡£Î񵀮½Ì¨ÊÇVisual
Studio2005£¬C#¡£
—————————————————————¸î—————————————————————————
Ê×ÏȽ«ÍøÒ³ÄÚÈÝÕû¸öץȡÏÂÀ´£¬Õâ¸öÎҾͲ»ËµÁË£¬²»ÊDZ¾´Î»°ÌâµÄÖØµã¡£¼ÙÉèץȡµÄÊý¾Ý·ÅÔÚRecvBufferÕâ¸öbyte[]ÖУ¨Êý¾Ý´ÓÍøÂçÉÏ´«Êä¹ýÀ´Ê±²»ÊÇ×Ö·û´®µÄÐÎʽ¶øÊÇbyte£©£¬ÄÇôÎÒÃǵĵÚÒ»²½¾ÍÊǽ«RecvBufferת»¯ÎªString£¬ÒÔ±ãÓÚ¶ÔÆä²Ù×÷£¬ÊµÀýÈçÏ£º
//
½«½ÓÊÕµ½µÄÊý¾ÝÔö¼Óµ½ÏìÓ¦×Ö·û´®ÖÐ
strResponse
+=
Encoding.ASCII.GetString(RecvBuffer,
0
, nBytes);
strResponse¼´ÊDZ£´æÊý¾ÝµÄ×Ö·û´®£¬´Ë´¦ÓÃϵͳ×Ô´øµÄSystem.Text.EncodingµÄ·½·¨×ª»¯RecvBuffer£¬GetStringµÄµÚÒ»¸ö²ÎÊýRecvBuffer¾ÍÊÇÎÒÃǵÄÔʼÊý¾Ý£¬¼´°üº¬ÐèÒª½âÂëµÄ×Ö½ÚÐòÁеÄ×Ö½ÚÊý×飻µÚ¶þ¸ö²ÎÊý0´ú±íµÚÒ»¸öÒª½âÂëµÄ×Ö½ÚµÄË÷Òý£¬Ò»°ã¾Í´Ó0¿ªÊ¼£»µÚÈý¸ö²ÎÊýnBytesΪҪ½âÂëµÄ×Ö½ÚÊý£¬¿ÉÒÔ×Ô¼ºµ÷Õû¡£
µÃµ½ÁËÊý¾ÝµÄ×Ö·û´®ÐÎʽ£¬È»ºó¿ÉÒÔ¶ÔÍøÒ³½øÐнâÎöÁË£¨Æäʵ¾ÍÊǶÔ×Ö·û´®µÄ¸÷ÖÖ²Ù×÷ºÍÕýÔò±í´ïʽµÄÓ¦Óã©¡£ÏÂÃæÎÒÒÔ¼¸¸öÀý×ÓÀ´ËµÃ÷¶ÔÍøÒ³Êý¾ÝµÄ½âÎö£º
//
½âÎöÒ³Ãæ£¬²éÕÒÁ´½Ó
//
´Ë´¦ÉÐÐèÀ©Õ¹£¬»¹ÓÐijЩÐÎʽµÄÁ´½Ó²»±»Ê¶±ð
string
strRef
=
@"
(href|HREF|src|SRC|action|ACTION|Action)[ ]*=[ ]*[""'][^""'#>]+[""']
"
;
MatchCollection matches
=
new
Regex(strRef).Matches(strResponse);
strStatus
+=
"
Ïà¹ØÎĵµ£º
¾³£ÒªÐ´Ò»Ð©.netµÄ³ÌÐò£¬¶ÔÓÚÊý¾Ý¿âµÄ·À×¢ÈëÒªÇóÒª±È½Ï¸ß¡£ÕâʱÎÒ´ÓÍøÉÏËÑÁËһЩ´úÂë¡£²é¿´ÁËÒ»ÏÂÖ÷ÒªÊÇͨ¹ýHTTPModelÀ´½øÐжԿͻ§¶Ëת¹ýÀ´µÄÊý¾Ý½øÐд¦Àí¡£
ÔÚ·þÎñÆ÷°²È«À¸Ä¿ÀïÎÒд¹ýһƪ¡¶ÆÆ½âͨÓÃSql·À×¢Èë·½·¨¡·µÄÎÄÕÂÖÐ˵µ½£¬Ò»Ð©Í¨ÓõķÀ×¢Èë·½·¨ÖÐûÓжÔcookieÊý¾Ý½øÐйýÂË£ ......
#region µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// <summary>
/// µÃµ½ËùÓб¾µØÍøÂçÖпÉʹÓõÄSQL·þÎñÆ÷Áбí
/// </summary>
/// <param name="p_strServerList">·þÎñÆ÷Áбí</param& ......
Ò»ÖÖ£º
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>¼æÈÝFireFoxµÄµ±Ç°Ê±¼äµÄJS½Å±¾</title>
</head>
<body>
<DIV id=time>µ±Ç°Ê±¼ä
<SCRIPT>document.getElementById('time').innerHTML=new Date().toLo ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; char ......
using System.Text.RegularExpressions; //ÒýÈëµÄÃüÃû¿Õ¼ä
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
//Çå³ýHTMLº¯Êý
public static string NoHTML(string Htmlstring)
{
//ɾ³ý½Å±¾
Htmlstr ......