本文介绍了通过ASP.Net进行设备控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是ASP.Net的新手,如果使用不正确的术语,请原谅我,我只是不知道从哪里开始.

我的设备壁橱中有一台服务器.在设备壁橱中,有几件音频视频设备.某些设备可以通过异步tcp/ip控制进行控制,而某些设备可以通过RS232进行控制.通过tcp/ip控制控制的设备直接连接到路由器,该路由器也在设备壁橱中.通过RS232控制的设备直接连接到服务器.所有不同的设备都可以接收和发送数据.最初,我使用vb.net创建了一个Windows应用程序来控制设备,这很好用,并且可以完美运行.该应用程序将运行,并且我将能够发送和接收数据.这包括打开设备,提高音量,更改频道等...我也会收到反馈,告诉我设备的状态.根据设备的不同,通信方式可以是ASCII或十六进制.

一段时间后,我开始考虑使用Windows服务器托管一个ASP.net网站来托管此应用程序以进行设备控制.通过这种设计,LAN上的任何计算机或电话都可以控制设备并检查状态.认为这是一个简单的过渡,所以我复制了代码并创建了一个表单,然后在服务器上运行了网站.不用说,它没有按我希望的那样工作.由于回发和网站的状态,它发送一次数据并关闭连接.这样,除非重新打开连接和其他许多问题,否则我不会收到数据,也无法重新发送数据.最初是一个有趣的项目,一个很酷的事情变成了让它工作的一种迷恋.我花了近一个月的时间试图弄清楚如何进行这项工作.我研究了WCF,Web服务和activeX控件.我似乎无法弄清楚是否可以做到这一点,什么是最好的方法.我试图学习所有这些新方法,但无济于事.

我绝不是专家,我喜欢喜欢挑战就喜欢将编程作为一种有趣的爱好,所以这是我的问题:

1).我可以使用ASP网站通过tcp/ip控制壁橱中的设备吗?

2).我可以通过使用ASP网站直接连接到服务器的RS232来控制壁橱中的设备吗?

3).如果可行,那么使这项工作最好的方法是什么?

在这种情况下,我很失落,我什至不知道是否可以做到,如果可以,我也不知道该怎么做.预先感谢您查看该帖子,我非常感谢任何指导.

Hello all, I am new to ASP.Net, please forgive me if I use incorrect terminology, I just do not know where to begin.

I have a server located in my equipment closet. In the equipment closet there are several pieces of audio video equipment. Some of the equipment can be controlled via asynchronous tcp/ip control and some can be controlled via RS232. The equipment that is controlled via tcp/ip control is directly connected to the router which is also in the equipment closet. The equipment that is controlled via RS232 to directly connected to the server. All the different equipment both receive and send data. Originally I created a windows application using vb.net to control the equipment, this worked great and I had it working perfectly. The application would run, and I would be able to send and receive data. This included turning on the equipment, raising the volume, changing channels,... I would also receive feedback telling me the status of the equipment. The communication was either in ASCII or hex, depending on the equipment.

After a while, I got to thinking of using the windows server to host an ASP.net website to host this application for equipment control. With this design, any computer or phone on the LAN can control the equipment and check status. Thinking that this was an easy transition, I copied the code and created a form and ran the website on the server. Needless to say, it didn''t work as I had hoped. Due to postbacks and the state of websites, it sends the data once and closes the connection. As such, I do not receive data back, I cannot resend data, unless I open the connection again and a number of other issues. What began as a fun project and a cool thing to do turned into an obsession to get it working. I have spent nearly a month trying to figure out how to make this work. I looked into WCF, web services and activeX controls. I cannot seem to figure out if this can be done and what is the best method. I have tried to learn all these new methods, to no avail.

I am by no means an expert, i enjoy programming as a fun hobby as i like challenges So here are my questions:

1). Can I control the equipment in my closet via tcp/ip using an ASP website?

2). Can I control the equipment in my closet via RS232 that is directly connected to the server using an ASP website?

3). If it is feasible, then what is the best way to make this work?

In this situation, I am so lost I do not even know if it can be done and if it can, I do not know how to go about doing it. Thank you in advance for looking at the post an I appreciate any guidance.

推荐答案


这篇关于通过ASP.Net进行设备控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 16:47