網址URL就是"E:\abc.txt"
授人以渔,不授人以鱼。
CLEAR ALL SET PATH TO "E:\Projects\mytools" SET PROCEDURE TO "MyTools" Main() CLEAR ALL RETURN PROCEDURE Main() LOCAL loForm loForm = CREATEOBJECT("_Form") WITH loForm .Caption = "WebBrowser測試" .WindowState = 2 .Show ENDWITH READ EVENTS ENDPROC DEFINE CLASS _Form AS myForm ADD OBJECT Web1 AS OleControl WITH OleClass = "Shell.Explorer.2" PROCEDURE Arrange WITH ThisForm.Web1 .Top = 0 .Left = 0 .Height = ThisForm.Height .Width = ThisForm.Width ENDWITH ENDPROC PROCEDURE Activate DODEFAULT() WITH ThisForm.Web1 .Navigate("http://) ENDWITH ENDPROC * 如果定位到http://網頁不成功,則轉向本地index.html網頁,前者定位成功時不會激發本事件 PROCEDURE Web1.NavigateError(tpDisp, tcURL, tcFrame, tnStateCode, tlCancel) This.Navigate("E:\Documents\index.html") ENDPROC ENDDEFINE