访问端口“COM1”被拒绝 [英] Access to the port 'COM1' is denied

查看:8392
本文介绍了访问端口“COM1”被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我特林打开COM1口,但我收到此错误信息访问端口COM1被拒绝。 Actualy,我写这封信通过网络发送短信的程序。我承认有可能是错误的,但拒绝访问不应相比发生错误。请给我任何解决方案。如果端口需要任何访问权限的话,我怎么可以给。

I am tring to open the COM1 port but I am getting this error message "Access to the port 'COM1' is denied". Actualy, I am writing a program for sending SMS via net. I accept there could be an error, but "Access denied" error should not arised. Please give me any solution. If port requires any access privileges then how can I give that.

推荐答案

首先,确保串行端口存在。检查设备管理器;我的电脑上单击鼠标右键,然后从上下文菜单中选择管理,选择设备管理器,展开端口COM和放大器; LPT。如果未列出COM1,您将需要启用它在BIOS中。

First, make sure the serial port exists. Check the Device Manager; right-click on My Computer, select "Manage" from the context menu, select "Device Manager", expand "Ports Com & LPT". If Com1 is not listed, you will need to enable it in the BIOS.

如果COM1是存在的,那么另一个程序已经离开它打开。访问COM1是独占的;只有一个程序可以拥有它同时打开。传真软件或调制解调器可以打开它,或者你可以离开它打开自己。

If COM1 is there, then another program has left it open. Access to COM1 is exclusive; only one program can have it open at a time. Fax software or a modem could have it open, or you could have left it open yourself.

这是很容易做到。如果您在打开的端口,却忘了关闭它,或者如果发生错误,程序终止,而不关闭该端口的程序工作,这是你会得到你尝试打开COM1下一次的消息。只有打开了该端口可以关闭它的程序。 抓或最后块好地方,关闭端口和prevent这一点。

This is easy to do. If you work on a program that opens the port and forget to close it, or if an error occurs and the program terminates without closing the port, this is the message you will get the next time you try to open COM1. Only the program that opened the port can close it. "Catch" or "Finally" blocks are good places to close the port and prevent this.

这篇关于访问端口“COM1”被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆