WPF 或 Windows 窗体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17317995/
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
WPF or Windows Form
提问by user423719
I have given a new project that is all about automation. I have to automate Windows & Web based applications from a .NET based application i.e. the .NET based application should be able to read controls of the external web application as well as the windows based applications in order to do get and push data.
我给出了一个关于自动化的新项目。我必须从基于 .NET 的应用程序自动化基于 Windows 和 Web 的应用程序,即基于 .NET 的应用程序应该能够读取外部 Web 应用程序的控件以及基于 Windows 的应用程序,以便获取和推送数据。
Kindly advise the .NET based application should be developed on Windows Forms technology or WPF/C#?
请建议基于 .NET 的应用程序应该在 Windows 窗体技术或 WPF/C# 上开发?
Also is there any way to automate Java Applet application from .NET/C#?
还有什么方法可以从 .NET/C# 自动化 Java Applet 应用程序?
Thanks in advance.
提前致谢。
回答by Wojciech Kulik
WPF is worth to learn. Many of standard UI modificiations which you'd like to do in WinForms will take a loooot of time and in WPF you can do most of them just like that.
WPF值得学习。您想在 WinForms 中进行的许多标准 UI 修改将花费大量时间,而在 WPF 中,您可以像这样进行大部分修改。
WPF has also many useful features, your application will be displayed the same way on each computer, no problems with font DPI etc.
WPF 也有很多有用的功能,你的应用程序在每台计算机上的显示方式都是一样的,字体 DPI 等没有问题。
In wpf you can easily add animations, gradients, styles, localization etc. I strongly recommend that over WinForms. Also WPF force good practices like MVVM pattern, because of which your code will be more flexible, maintainable and readable.
在 wpf 中,您可以轻松添加动画、渐变、样式、本地化等。我强烈建议使用 WinForms。此外,WPF 强制使用 MVVM 模式等良好实践,因此您的代码将更加灵活、可维护和可读。
Everything depends on what is your goal and how often do you want to use that technology. If you want to create small application one/twice a year, then there is no reason to learn WPF which is more complex, but if you want to create more projects and learn something once, which give you great flexibility then you should definitely learn WPF.
一切都取决于您的目标是什么以及您希望多久使用一次该技术。如果你想每年创建一个/两次的小应用程序,那么没有理由学习更复杂的 WPF,但是如果你想创建更多的项目并学习一次,这给你很大的灵活性,那么你绝对应该学习 WPF .
回答by Alexander Smirnov
WPF and WinForms mostly differs in UI contruction approach. If you don't need UI you can stick to any of them, overwise i'll advice you to use WPF as it is much more flexible and design-friendly than WinForms. Though WinForms is easier to use for basic UI if you don't know WPF, IMHO.
WPF 和 WinForms 的主要区别在于 UI 构造方法。如果您不需要 UI,您可以坚持使用其中任何一个,否则我会建议您使用 WPF,因为它比 WinForms 更加灵活和设计友好。如果您不了解 WPF,虽然 WinForms 更容易用于基本 UI,恕我直言。

