好,举个例 ;)asp sample try{ conn.Execute(querystring,adCmdTable); }catch(e) { Response.Write("can't find out anything according to querying"); Response.End(); }finally{ //normal display } vbs如果querystring有错,那么vbs总会报错。 我就喜欢js里的try,catch能够捕捉错误多好啊
晕倒, 干吗要用VBS来写类, 在客户端来说JS绝对比VBS好用, 通用.<script language=javascript> function chiny() { this.hello = function() { alert("hello"); } }var person = new chiny();person.hello(); </script>
不是这个意思,因为有个家伙写了一个庞大的VBS包,我调用, 我自己写的就是js
用vb编译成dll~然后activex调用~
set person = new chiny
vbs的错误捕捉: on error resume next ... if err.number>0 then response.write(err.description) end if on error goto 0
<script language=vbs> class chiny Private Sub Class_Initialize()
End Sub public sub hello() msgbox "hello" end sub end class function GetObj() set GetObj= new chiny end function</script> <script language=JScript> var person=GetObj(); person.hello();</SCRIPT>
;)asp sample
try{
conn.Execute(querystring,adCmdTable);
}catch(e)
{
Response.Write("can't find out anything according to querying");
Response.End();
}finally{
//normal display
}
vbs如果querystring有错,那么vbs总会报错。
我就喜欢js里的try,catch能够捕捉错误多好啊
function chiny()
{
this.hello = function()
{
alert("hello");
}
}var person = new chiny();person.hello();
</script>
我自己写的就是js
on error resume next
...
if err.number>0 then
response.write(err.description)
end if
on error goto 0
class chiny
Private Sub Class_Initialize()
End Sub
public sub hello()
msgbox "hello"
end sub
end class
function GetObj()
set GetObj= new chiny
end function</script>
<script language=JScript>
var person=GetObj();
person.hello();</SCRIPT>