ÈçºÎץȡÍøÒ³Êý¾Ý¡¢·ÖÎö²¢ÇÒÈ¥³ý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Êý¾Ý½øÐйýÂË£ ......
Æäʵ¾ÍÊÇ´´½¨ÆÕͨÎļþ, CreateFile() ºÍWriteFile. È»ºóÓÃShellExcuteEx()À´´ò¿ª¾ÍÐÐÁË(»á×Ô¶¯µ÷ÓÃIE).
HANDLE handle;
handle=CreateFile(L"\\windows\\google.html",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if(INVALID_HANDLE_VALUE!= handle )
{
DWORD Num;
::WriteF ......
Ò»£®ÊôÐÔ£º
src£º¸ÃÊôÐÔÖ¸¶¨ÍⲿJavaScriptÎļþµÄµØÖ·£¬¿ÉÒÔ¿çÓò¡£Èç¹ûÖ¸¶¨Á˸ÃÊôÐÔ£¬ÄÇôscript±êÇ©ÖеÄÄÚÈݾͻᱻºöÂÔ¡£
type£ºÖ¸¶¨ËùʹÓõĽű¾ÓïÑÔ£¬¿ÉÒÔ¸²¸ÇĬÈϵĽű¾ÓïÑÔ£¨¼´ÔÚ<META http-equiv="Content-Script-Type" content="type">Öж¨ÒåµÄ½Å±¾ÀàÐÍ
£©¿ª·¢Õß±ØÐëÖ¸¶¨¸ÃÊôÐÔ£¬¸ÃÊôÐÔûÓÐĬÈÏÖµ¡ ......
<!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 ......
flexǶÈëµ½html£º
ÓÃswfobject,ÏÂÔصÄ.jsµØÖ·£ºhttp://www.adobe.com/devnet/activecontent/articles/devletter.html
ÔÚÄãµÄ HTML Ò³ÃæÍ·²¿<head>ÇøǶÈëÕâ¸ö½Å±¾Îļþ£º<script type="text/javascript" src="swfobject.js"></script>
ÔÚÄãµÄ HTML ÖÐдһ¸öÓÃÀ´·Å Flash µÄÈÝÆ÷£¬±ÈÈç<div> ......