C# 开发一个简单的 Windows 系统托盘桌面应用程序来使用 .NET Web 服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13643691/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 09:18:45  来源:igfitidea点击:

Developing a simple Windows system tray desktop app to consume a .NET web service

c#.netweb-servicesairsystem-tray

提问by Cogicero

I'm required to develop a simple Windows system tray desktop app to consume a .NET web service but I'm proficient in PHP, and I have little background in desktop applications. What platform would you advise me to use, preferably with a very low learning curve?

我需要开发一个简单的 Windows 系统托盘桌面应用程序来使用 .NET Web 服务,但我精通 PHP,而且我对桌面应用程序几乎没有背景。你会建议我使用什么平台,最好是学习曲线非常低?

The system tray app will show (in a context menu) a counter of notifications of new events as received from the .NET web service; and will also write all the event logs into a text file.

系统托盘应用程序将显示(在上下文菜单中)从 .NET Web 服务接收到的新事件通知计数器;并且还将所有事件日志写入文本文件。

I'm already thinking Adobe AIR or C# .NET but I want to know if there are any better options that I can learn quickly to develop the app.

我已经在考虑使用 Adob​​e AIR 或 C# .NET,但我想知道是否有更好的选择可以让我快速学习来开发应用程序。

采纳答案by Lloyd

Keep it all in .NET. You can easily write a Windows Forms application to display a tray icon and display notifications as and when something happens in the web service (you'd probably need a timer to do the polling).

将其全部保存在 .NET 中。您可以轻松编写 Windows 窗体应用程序来显示托盘图标并在 Web 服务中发生某些事情时显示通知(您可能需要一个计时器来进行轮询)。

There are plenty of articles around that will show you how to do this. Here's one to get you started:

有很多文章会告诉你如何做到这一点。这里有一个让你开始:

http://www.codeproject.com/Articles/290013/Formless-System-Tray-Application

http://www.codeproject.com/Articles/290013/Formless-System-Tray-Application

回答by Developer

I assume that you have to use WPF and MVVM so it is going to be really awesome app.

我假设您必须使用 WPF 和 MVVM,因此它将成为非常棒的应用程序。

And the best example I found is that one

我发现的最好的例子是

WPF NotifyIconhttp://www.codeproject.com/Articles/36468/WPF-NotifyIcon

WPF NotifyIcon http://www.codeproject.com/Articles/36468/WPF-NotifyIcon