dim mycom1 = new IoCom.CommPort()if mycom1.opened then mycom1.Close() mycom1.open()else mycom1.open()end if
楼主暂时可以用外部引用来判断。试试是否可行?