是否可以使用 asp.net 通过 GSM 调制解调器连接和发送消息?
是否可能使用 asp.net 通过 GSM 调制解调器连接并发送消息?
I ve developed a c# winforms application for sending sms by using this article of Sending sms using GSM It works pretty well... Now i want to send sms using GSM communication (ie) a mobile phone connected to PC and i have detect it and send sms using it in asp.net.....
Is it possible Connecting and sending message through GSM modem using asp.net?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当然可以!唯一的一点是,由于 ASP.NET 是服务器端编程,因此 GSM 调制解调器必须连接到运行该应用程序的服务器。甚至,您已经开发的代码可以重复使用。将该代码作为具有公共接口的程序集来获取功能。将其包含在 ASP.NET 应用程序中,您就可以发送短信。
Of course you can! The only point is that, as ASP.NET is a server side programming, the GSM modem will have to be connected to the server running the app. Even, your already developed code can be reused. Put that code as an assembly with public interface to get the functionalities. Include it in the ASP.NET app and you can send SMS.
如果您的应用程序是常规控制台/winforms 应用程序或 ASP.NET 应用程序,则应该没有区别。
如果互联网上的任何人都能够连接到您的网站并发送消息,您只是想更加注意安全......
There should be no difference if your app is a regular console/winforms app or whether it's an ASP.NET app.
You would just want to be a bit more security-conscious if anyone on the internet is able to connect to your website and send messages...
是的。您可以创建一个 Windows 服务,其中包含访问 GSM 调制解调器和发送 SMS 消息的逻辑。然后可以从 ASP.NET Web 应用程序访问该服务。
有很多关于将 WCF 服务作为 Windows 服务运行的文章,MSDN 上有一篇文章,托管和使用 WCF 服务。
但转念一想,在这里建立一个服务可能有点矫枉过正。您也可以在应用程序中使用您的库。
Yes. You could create a Windows service that contains the logic for accessing the GSM modem and sending SMS messages. This service can then be access from your ASP.NET web application.
There are lots of articles out there on running a WCF service as a Windows service, here's one on MSDN, Hosting and Consuming WCF Services.
But on second thought, setting up a service may be overkill here. You could use your library from within your app just as fine.
你可以按照康坎在他的回答中提到的那样去做。您需要将调制解调器连接到服务器,但这样做不太可行,而且非常不推荐。您可以选择的最佳选择是订阅第三方 SMS 网关并通过其 HTTP API 发送 SMS。有许多此类提供商可以提供此类服务。只需用谷歌搜索一下,您就会找到最适合您需求的一个。
You can do it as mentioned by Kangkan in his answer. You will need to connect your modem to the server which is less feasible and very much less recommended to do so. The best option you can have is to subscribe to a third-party SMS gateway and send SMS through their HTTP apis. There are many such providers available that provide this kindaa service. Just google them and you'll find the one that best suits your needs.