简体   繁体   English

将Windows窗体应用程序连接到C#Web服务?

[英]Connecting a windows forms application to a C# web service?

I've created two applications, one windows forms application in Vb.net and another web service application in C# and MVC. 我创建了两个应用程序,一个是Vb.net中的Windows窗体应用程序,另一个是C#和MVC中的Web服务应用程序。

Whats the best way of connecting the 2. The windows forms app is for attendance checking, so the application will currently need a user to input attendance information and write to a local access database. 连接2.的最佳方法是什么。Windows窗体应用程序用于考勤检查,因此该应用程序当前将需要用户输入考勤信息并写入本地访问数据库。

I was thinking of creating a REST API for my web service which would allow the windows forms application to call the data and add any new check ins that have occurred. 我当时正在考虑为我的Web服务创建一个REST API,这将允许Windows窗体应用程序调用数据并添加已发生的任何新签入。 I'm wondering though how would my windows forms application know when to call the REST API for the web service when new data is added? 我想知道,当添加新数据时,我的Windows窗体应用程序如何知道何时调用Web服务的REST API?

Any help would be much appreciated. 任何帮助将非常感激。

You pretty much figured out by you own. 您几乎是自己想出来的。 You can either use WCF or Web API, both will work fine for your purpose. 您可以使用WCF或Web API,两者都可以正常工作。 If you want to know the difference, please read this link 如果您想知道区别,请阅读此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM