<script language="javascript" type="text/javascript">
var msComm1 = null;
try {
msComm1 = new ActiveXObject("MSCOMMLib.MSComm.1");
}
catch (err) {}
if ((typeof (msComm1) == "undefined") || (msComm1 == null)) {
alert("msComm1 is null");
}
else
{
alert("OK!!!!!!!!!!!!!! msComm1 is not null");
}
</script>
注意: 要先在服务器上注册MSComm。 在客户端还要设置IE的ActiveX安全属性