vb.net中获取错误信息

方法1:try...catch...end try
    其中catch中的e可以捕获错误并进行描述。
方法2:on error goto
    原来vb中使用的,依然可以用。
方法3:getlasterror()
    api函数,可以捕获错误
方法4:err.dlllasterr()
    不可小看此函数,可以捕获dll中的错误,有些api调用不会导致getlasterror,更多的是没有提示,给程序员代来很大的麻烦,可以用此函数捕获调用中的错误,如果在使用了api调用dll时候出现错误,并且用个体lasterror不能确定错误原因,就用它吧。

posted on 2006-02-17 13:21  Urusei  阅读(613)  评论(0)    收藏  举报

导航