调用一个函数/事件或将数据传递给网站(C#),只要变量的值的Web服务的改变 [英] Call a function/event or pass data to Website(C#) whenever value of variable changed in Web-service

查看:163
本文介绍了调用一个函数/事件或将数据传递给网站(C#),只要变量的值的Web服务的改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个是听的事件连接(USB端口)的设备并传递事件名称到网络服务的一个Windows应用程序(在实时)。
而且我有,我想根据设备的事件执行某些操作(实时)网站

I have one windows application which is listening to events of a device attached(on USB port) and passing event name to web service(In Real Time). And I have a website on which I want to perform certain operations according to the event of device(In Real Time).

所以,我想通过数据或致电网站的功能,每当一个新的事件值从Windows应用程序通过。

So I want to pass data or call function on website whenever a new event value is passed from windows application.

我试图使用定时网页被调用的Web服务,以获得最新的价值上。但问题是,事件被非常迅速改变。

I tried to use timer on web page which is calling Web-service to get latest value. But the problem is that events are changing very rapidly.

是否有任何方式的Web服务的一些数据自动发送到我的网站?或任何其他解决方案。

在此先感谢

推荐答案

随着我所知,我想你不能只是直接通过您的网站从Web服务中的数据,因为服务本身不知道它与连接

With the best of my knowledge, I think you cannot just directly pass the data on your website from the web service, since the service itself doesn't know to which it is connected with.

有关您的情况我会做什么,使得在它的一些要求表的数据库,并在那里将数据从一个网络存储的方法时,它是由你的Windows应用程序调用,因为您的应用程序完全是建立在.NET上你可以简单地传递该数据表对象而不必解析在另一侧的XML数据。现在,做一个Web方法将从数据库返回该数据。打电话从您的网站本网站的方法。当数据已被发送到网站,可以不过从数据库中删除它,以使新的数据,然后可以在下一呼叫被发送。

For your scenario what I will do is, make a database with some required tables in it and store the data in there from a web method whenever it is called by your windows application, since your application is entirely built on .NET you can simply pass the DataTable object without having to parse the XML data on the other side. Now, make a web method that will return this data from the database. Call this web method from your website. When the data has been sent to the website, you can however delete it from the database so that the new data can then be sent in the next call.

它可以帮助你!

这篇关于调用一个函数/事件或将数据传递给网站(C#),只要变量的值的Web服务的改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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