[delphi×é¼þ] WebbrowserµÄʹÓÃ
delphiÖÐWebbrowserµÄʹÓÃ
1.»ñµÃÍøÒ³ÖбäÁ¿Öµ
htmÖÐ<script> var currID=123</script>
³ÌÐòÖпÉÒÔÕâôµ÷Óà id := Form1.WebBrowser1.OleObject.Document.script.currID
ÖµµÃ˵Ã÷µÄÊÇ,±äÁ¿¿ÉÒÔÊÇjavascript¶¨ÒåµÄ,Ò²¿ÉÒÔÊÇvbscript¶¨ÒåµÄ,Èç¹ûWebbrowser1ÖÐÕÒ²»µ½¸Ã±äÁ¿,µ÷Óûᴥ·¢Ò»¸öÒ쳣ʼþ,¼´±äÁ¿currID²»´æÔÚ
2.Ö´ÐÐÍøÒ³Öеĺ¯Êý
tmp := 'currID = getNextID(currID)'+#13#10;
Form1.WebBrowser1.OleObject.Document.parentWindow.execScript(tmp,'JavaScript');
µ÷Óú¯ÊýµÄ·½·¨¾ÍÊÇexecScript½Ó¿Ú,ͬÑù,Èç¹ûº¯Êý²»´æÔÚ,»òÕßÔËÐдíÎóÒ²»á´¥·¢½Å±¾´íÎóÒì³£
3.ÉèÖÃÍøÒ³±³¾°
±³¾°Í¼Æ¬ WebBrowser1.OleObject.Document.body.background := 'http://seelearn.com/bg.gif'
±³¾°ÑÕÉ« WebBrowser1.OleObject.Document.body.bgcolor := '#eeeeee'
4.µ÷ÓÃÍøÒ³ÖÐÒÑÖª¶ÔÏó
src := WebBrowser1.OleObject.Document.getElementByID('img1').src
¸Ã·½·¨Æäʵ¾ÍÊÇjavascriptÖÐµÄ getElementByID
5.»ñÈ¡Ò³ÃæÖÐËùÓеÄframe
ʹÓÃDHTML¡£
frames:=wb.OleObject.document.frames;
for i:=0 to frames.length do
memo1.lines.Add(frames[i].document.body.innerHTML);
6.BorderStyle=bsNoneºóWebbrowser»á±»ÖØÐ³õʼ»¯
ÕâÊÇÒ»¸öÈÃÈ˺ÜÒâÍâµÄÒ»¸öÎÊÌâ,DelphiÔÚ´°¿Ú¿Ø¼þµÄ¿ØÖÆ·½Ãæ×öµÃ·Ç³£ºÃ,ºÜÉÙ³öÏÖÕâÖÖBUG
¸ù¾Ý·ÖÎö,³öÏÖÕâ¸öÏÖÏóÓкܶàÇé¿ö ¸Ä±äFormStyleÒ²»á³öÏÖ ; Èç¹û webbrowser.parent ÓÉpanel1 ¸Äµ½panel2.Ò²»áµ¼ÖÂwebbrowserÖØÐÂ
³õʼ»¯¡£
7.Ö±½ÓÏòWebbrowserÖÐдÈëhtml´úÂë,²»ÐèÒªNavigateµ½Êµ¼Ê´æÔÚµÄÎļþ
var
StrStream:TStringStream;
SetNoteStr: string;
Ïà¹ØÎĵµ£º
C#µÄToolTip£¨delphi½ÐHint£©»úÖÆ·Ç³£¹Ö£¬²»ÊÇÏñdelphiµÄÔª¼þÒ»Ñù£¬Ã¿¸öTControlÓÐÒ»¸öHintÊôÐÔ£¬C#ÓÐÒ»¸öToolTipÔª¼þ£¬µ±°ÑÕâ¸öÔª¼þ´Ó¹¤¾ßÏäÀµ½formÉϺó£¬Ñ¡ÖÐformÉϵÄÈκÎcontrolÔª¼þ£¬ÔÚÊôÐÔ´°Ì壨Object Inspector£©ÉϾͻá¶à³öÒ»¸öÊôÐÔ“toolTip1ÉϵÄToolTip”£¬Èç¹û¶àÀ¼¸¸ ......
TCPÁ¬½Ó½¨Á¢Óë¹Ø±Õ
ÏàП÷λ¶ÁÕßÏÖÔÚ¶Ôì¶ Winsock µÄ¶¨Ò塢ϵͳ»·¾³£¬ÒÔ¼°Ò»Ð© Winsock Stack¼° Winsock Ó¦ÓóÌʽ£¬¶¼Óлù±¾µÄÈÏʶÁË¡£½ÓÏÂÀ´±ÊÕßÏ£ÍûÄÜ·Ö¼¸ÆÚΪ¸÷λ¶ÁÕß½éÉÜһϼòµ¥µÄ Winsock ÍøÂ·Ó¦ÓóÌʽÉè¼Æ¡£ÎÒÃǽ«ÒÔ Winsock 1.1 ¹æ¸ñËù¶¨ÒåµÄ 46 ¸öÓ¦ÓóÌʽ½éÃæ£¨API£©Îª»ù´¡£¬Öð²½À´½¨Á¢Ò»¶Ô TCP socket Ö÷´Ó¼Ü ......
Delphi¼üÅ̰´¼üαÂë
Ó÷¨£ºif key = chr(VK_RETURN) then...
³£ÊýÃû³Æ Ê®Áù½øÖÆÖµ Ê®½øÖÆÖµ ¶ÔÓ¦°´¼ü
VK_LBUTTON 01 1 Êó±êµÄ×ó¼ü
VK_RBUTTON 02 2 Êó±êµÄÓÒ¼ü
VK-CANCEL 03 3 Contol-break Ö´ÐÐ
VK_MBUTTON 04 4 Êó±êµÄÖмü£¨Èý°´¼üÊó±ê)
VK_BACK 08 8 Backspace¼ü
VK_TAB 09 9 Tab¼ü
VK_CLEAR 0C 12 Clear¼ü
VK ......
Delphi±àдϵͳ·þÎñÆß£ºÍê³É¶Ë¿ÚÑÝʾ ÊÕ²Ø
ÔÚ¿ª·¢´óÁ¿Socket²¢·¢·þÎñÆ÷£¬Íê³É¶Ë¿Ú¼ÓÖØµþI/OÊÇÆù½ñΪֹ×îºÃµÄÒ»ÖÖ½â¾ö·½°¸£¬ÏÂÃæÊǼòµ¥µÄ½éÉÜ£º
“Íê³É¶Ë¿Ú”Ä£ÐÍÊÇÆù½ñΪֹ×îΪ¸´ÔÓµÄÒ»ÖÖI/OÄ£ÐÍ£¬ÌرðÊʺÏÐèҪͬʱ¹ÜÀíΪÊýÖÚ¶àµÄÌ×½Ó×Ö£¬²ÉÓÃÕâÖÖÄ£ÐÍ£¬ÍùÍù¿ÉÒÔ´ïµ½×î¼ÑµÄϵͳÐÔÄÜ¡£µ«ÊÇÖ ......