简体   繁体   English

Powerwise:在C#(。NET)中使用控制台或Windows GUI应用程序更好吗?

[英]Powerwise: Is it better to use console or windows GUI application in C#(.NET)?

If we are writing about power-wise option - is using a console-based application in C#(.NET) better than having Windows GUI and what's the real difference expept few libraries loaded in operational memory? 如果我们写的是明智的选择-在C#(。NET)中使用基于控制台的应用程序是否比Windows GUI更好,那么真正的区别是在操作内存中加载了几个库?

The issue is about text comparisons and working with strings, connecting to Internet, gathering data, working with database. 问题在于文本比较和使用字符串,连接到Internet,收集数据,使用数据库。

I meant power-capability, but as I've read here, it's more about controls than any power-relation. 我的意思是电源功能,但是正如我在这里所读到的,它更多地是关于控件而不是任何电源关系。 Thx :) 谢谢 :)

I'm not entirely sure what your requirements are. 我不确定您的要求是什么。 GUIs tend to be harder to write than console apps, but open up a great level of usability (if you design them well, which is another matter entirely). GUI往往比控制台应用程序更难编写,但是却提供了很高的可用性(如果设计得当,则完全是另一回事)。

If it's a simple tool that doesn't really need interactivity: start with some command line arguments, process and report progress, finish - then I'd write a console app. 如果它是一个真正不需要交互性的简单工具:从一些命令行参数开始,处理并报告进度,完成-然后,我将编写一个控制台应用程序。 If more interactivity is required, go for a GUI. 如果需要更多的交互性,请选择GUI。

From your description it seems that you want to write an HTML scraping software or some kind of web spider. 从您的描述看来,您似乎想编写HTML抓取软件或某种Web蜘蛛。 I think your decision whether to write a GUI or a command line application should depend on who (users) or which other software components will use or integrate your program. 我认为您是否编写GUI或命令行应用程序的决定应取决于谁(用户)或将使用或集成您的程序的其他软件组件。

If there is no user interaction involved, I guess it would be just fine to write it as command line program. 如果没有用户交互,我想将其编写为命令行程序就可以了。 If you have some options to set you could pass them as arguments. 如果您要设置一些选项,则可以将它们作为参数传递。

If it will be a recurring, isolated job, you could also consider writing the application as windows service , which could start with the machine. 如果这将是一项经常性的隔离工作,您还可以考虑将应用程序编写为Windows服务 ,可以从计算机开始。

A software without GUI will have many extra clock available. 没有GUI的软件将有许多额外的时钟可用。 It takes resources to display a GUI... On today computer, a simple GUI will not really affect the performance. 显示GUI需要花费资源。在当今的计算机上,简单的GUI并不会真正影响性能。

If you looking for have the better computation power, having a multi-thread architecture should give you a lot more power that console vs GUI. 如果您希望拥有更好的计算能力,那么拥有多线程体系结构应该比控制台和GUI拥有更多的功能。

There is no difference in what you can do with the things you mentioned (strings, internet, database). 您所提到的内容(字符串,Internet,数据库)可以做什么都没有区别。 The difference between console and GUI apps is solely in how you interact with the user. 控制台和GUI应用程序之间的区别仅在于您与用户交互的方式。 Everything else is the same. 其他一切都一样。

If you meant power consumption instead, then I'm afraid I misunderstood your question. 如果您的意思是功耗,那么恐怕我误解了您的问题。

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

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