C# “windows 应用程序”和“windows 窗体应用程序”有什么区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19668716/
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
What is the difference between "windows application" and "windows forms application"
提问by GeezerGeek
I was trying to use a third-party component developed in C# in a VB.NET project. When I tried to add the component to the toolbox the components were always greyed out - disabled. After much searching on this problem (example, one of many: Visual Studio 2010 toolbox controls disabled or inactive) I found that the components were probably not enabled because they were created for a different sort of project. The usual example given is "web application" vs. "windows application".
我试图在 VB.NET 项目中使用用 C# 开发的第三方组件。当我尝试将组件添加到工具箱时,组件总是变灰 - 禁用。在对此问题进行大量搜索后(例如,其中之一:Visual Studio 2010 工具箱控件已禁用或不活动),我发现这些组件可能未启用,因为它们是为不同类型的项目创建的。给出的通常示例是“Web 应用程序”与“Windows 应用程序”。
I looked at the demo project that came with the components and the demo project output type is "Windows Application". The VB.NET project I'm trying to build using the component is a "Windows Forms Application". Since this is VS Express, these are the only Windows application types available in the two projects.
我查看了组件附带的演示项目,演示项目的输出类型是“Windows 应用程序”。我尝试使用该组件构建的 VB.NET 项目是“Windows 窗体应用程序”。由于这是 VS Express,因此这些是两个项目中唯一可用的 Windows 应用程序类型。
My question is, what is the difference between these two output types? Both output types are <OutputType>WinExe</OutputType>
in the project file. Can I rebuild the components to work in a "Windows Forms Application" and if so, how?
我的问题是,这两种输出类型有什么区别?两种输出类型都<OutputType>WinExe</OutputType>
在项目文件中。我可以重建组件以在“Windows 窗体应用程序”中工作吗?如果可以,如何重建?
回答by Monika
Console Applications don't have user interfaces and are run in the Command Prompt. Windows Forms applications do have user interfaces.
控制台应用程序没有用户界面,在命令提示符中运行。Windows 窗体应用程序确实具有用户界面。
That's probably the biggest difference.
这可能是最大的区别。
A Windows form application is an application that has a graphical user interface(GUI) like the Visual C# IDE. A console program on the other hand is a text application. There are not fancy controls like buttons or textboxes in a console application and they are run from the command prompt.
Windows 窗体应用程序是具有图形用户界面 (GUI) 的应用程序,如 Visual C# IDE。另一方面,控制台程序是文本应用程序。控制台应用程序中没有像按钮或文本框这样的花哨控件,它们是从命令提示符运行的。
回答by GeezerGeek
From the clue given by @HighCore I am going to assume that the "Windows Application" is a WPF application, and that the "Windows Forms Application" is a WinForms application and the two are not compatible. If someone could supply a more complete answer than this it would be great.
根据@HighCore 给出的线索,我将假设“Windows 应用程序”是一个 WPF 应用程序,而“Windows 窗体应用程序”是一个 WinForms 应用程序,两者不兼容。如果有人可以提供比这更完整的答案,那就太好了。
回答by gbk
Look here
看这里
In the case of "Microsoft Windows", windowsprograms are software applicationsthat are run on a computer that is also running Microsoft Windows as an operating system. A software application, or program, is a set of logical conditions grouped together to perform some function. Typically a Microsoft Windows application will be run within a "window" although that is not a requirement. A "window" in the context of software is an area of the screen set aside to run a single program and may or may not have options for controlling the position and size of the program area. Some examples of Microsoft Windows applications are:
在“Microsoft Windows”的情况下,Windows程序是在也运行 Microsoft Windows 作为操作系统的计算机上运行的软件应用程序。软件应用程序或程序是一组组合在一起以执行某些功能的逻辑条件。通常,Microsoft Windows 应用程序将在“窗口”内运行,尽管这不是必需的。软件上下文中的“窗口”是为运行单个程序而预留的屏幕区域,并且可能具有也可能没有用于控制程序区域的位置和大小的选项。Microsoft Windows 应用程序的一些示例是:
- Microsoft Excel
- Microsoft Internet Explorer
- Notepad
- Mozilla Firefox
- 微软Excel
- 微软 Internet Explorer
- 记事本
- 火狐浏览器
Windows*Forms*(WinForms) is the name given to the graphical applicationprogramming interface (API) included as a part of Microsoft .NET Framework, providing access to native Microsoft Windows interface elements by wrapping the extant Windows API in managed code. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library, it does not offer a paradigm comparable to Model–View–Controller. Some after-market and third party libraries have been created to provide this functionality. The most widely used of these is the User Interface Process Application Block, which is released by the Microsoft patterns & practices group as a free download that includes the source code for quick start examples.
Windows* Forms*(WinForms) 是作为 Microsoft .NET Framework 一部分包含的图形应用程序编程接口 (API)的名称,通过将现存的 Windows API 包装在托管代码中来提供对本机 Microsoft Windows 界面元素的访问。虽然它被视为早期和更复杂的基于 C++ 的 Microsoft 基础类库的替代品,但它没有提供可与模型-视图-控制器相媲美的范式。已经创建了一些售后市场和第三方库来提供此功能。其中使用最广泛的是用户界面流程应用程序块,它由 Microsoft 模式与实践组作为免费下载发布,其中包括快速入门示例的源代码。
also Windows Application include and WPF application (WPF - Windows Presentation Foundation) and Windows Form Application
还包括 Windows 应用程序和 WPF 应用程序(WPF - Windows Presentation Foundation)和 Windows 窗体应用程序
WPF - look here
WPF -看这里
Hope this information wiil be helpfull for you
希望这些信息对你有帮助
回答by Mohammed Nazrudeen
Console application
控制台应用程序
Console applications are light weight programs run inside the command prompt (DOS) window. They are commonly used for test applications.
控制台应用程序是在命令提示符 (DOS) 窗口内运行的轻量级程序。它们通常用于测试应用程序。
Console-based applications include Alpine (an e-mail client), cmus (an audio player), Irssi (an IRC client), Lynx (a web browser), Midnight Commander (a file manager), Music on Console (an audio player), Mutt (an e-mail client), nano (a text editor), ne (a text editor), newsbeuter (an RSS reader), and ranger (a file manager).
基于控制台的应用程序包括 Alpine(电子邮件客户端)、cmus(音频播放器)、Irssi(IRC 客户端)、Lynx(网络浏览器)、Midnight Commander(文件管理器)、Music on Console(音频播放器) )、Mutt(电子邮件客户端)、nano(文本编辑器)、ne(文本编辑器)、newsbeuter(RSS 阅读器)和 ranger(文件管理器)。
Windows ApplicationWindows Applications are form based standard Windows desktop applications for common day to day tasks. Microsoft word is an example of a Windows application.
Windows 应用程序Windows 应用程序是基于表单的标准 Windows 桌面应用程序,用于日常任务。Microsoft word 是 Windows 应用程序的一个示例。