我又憨胆大,改成直接调用了
bFpdm = thisform.wb.document.Script.afcdm(of.wb.Document.getElementByid("fpdm").value)
bFpdm = thisform.wb.document.Script.ahmch(of.wb.Document.getElementByid("fphm").value)
达到效果了
完整代码
of = CREATEOBJECT("webForm")
of.show
READ EVENTS
RETURN
DEFINE CLASS webForm AS Form
ShowWindow = 2
WindowState = 2
ADD OBJECT txt1 as textbox WITH left=10,top=10,width=130,height=22,value="051002000511"
ADD OBJECT cmd1 as commandbutton WITH left=150,top=10,height=22,Enabled=0,caption="test"
ADD OBJECT WB AS Olecontrol WITH left=0,top=42, Width=this.width,Height=this.height-42,Anchor=15,OleClass="Shell.Explorer.2",Visible=.T.
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
PROCEDURE Init
this.WB.Silent = 0
&&提示安全证书问题警告
this.WB.Navigate("https://inv-veri.chinatax.)
ENDPROC
PROCEDURE WB.documentComplete(pdisp, url)
IF SYS(3095,pdisp)==SYS(3095,this)
thisform.wb.Document.parentWindow.execScript(jsCode)
thisform.cmd1.Enabled = 1
ENDIF
ENDPROC
PROCEDURE cmd1.click
of.wb.Document.getElementByid("fpdm").value="051002000511"
of.wb.Document.getElementByid("fphm").value="12345678"
bFpdm = thisform.wb.document.Script.afcdm(of.wb.Document.getElementByid("fpdm").value)
bFpdm = thisform.wb.document.Script.ahmch(of.wb.Document.getElementByid("fphm").value)
ENDPROC
ENDDEFINE