简单的无头窗口应用程序的项目类型 [英] Project Type for simple headless windows application

查看:27
本文介绍了简单的无头窗口应用程序的项目类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 Windows 应用,该应用将在 Windows 2012r2 上运行,并且很快将迁移到更新的服务器.

I am creating a Windows app that will run on Windows 2012r2 and soon be migrated to newer servers.

此应用程序将从任务计划程序启动并每天运行数次.

This app will be started from task scheduler and run several times a day.

它将启动,监视文件系统,并根据在文件系统上找到的内容更新数据库.

It will start up, monitor a file system and, based on what it finds on the file system, will update a database.

我希望它即使在用户未登录时也能运行.

I want it to run even when the user is not logged in.

我不希望它在运行时弹出控制台窗口,因为我继承了一些正在执行此操作的应用程序,这很烦人.

I don't want it to pop up a console window while it is running because I inherited some applications that are doing that and it is quite annoying.

我将用 C# 编写它.

I will be writing it in C#.

在 Visual Studio 2017 中,我应该选择哪种项目类型?

In Visual Studio 2017 which project type should I choose?

  1. 空白应用
  2. WPF 应用程序
  3. 控制台应用程序 (.NET Core)
  4. 控制台应用(.NET 框架)
  5. 其他?

我是 Windows 开发的新手,所以请使用我将在 Visual Studio 2017 中看到的术语,以便我能够理解答案.

I am new to Windows development so please use terminology that I will see in Visual Studio 2017 so I can understand the answer.

我将控制台应用程序 (.Net Standard) 更改为 (.Net Framework),因为 Standard 不存在.当我将其列为一个选项时,我正遭受着暂时的精神错乱.

I changed Console App (.Net Standard) to (.Net Framework) because Standard does not exist. I was suffering from temporary insanity when I listed that as an option.

推荐答案

由于没有用户界面,而且您只是在监视文件系统和更新数据库并在 Window Server 上运行,因此我建议:4. 控制台应用程序 (.NET Framework),并在应用程序的应用程序/属性中将输出类型设置为 Windows 应用程序,这将阻止显示任何类型的控制台窗口.这是我经常使用的应用程序类型来完成与您所描述的任务非常相似的任务.您对登录服务器的用户帐户的安全设置将决定您是否可以运行它,无论用户是否登录.

Since there is no user interface, and you are just monitoring the file system and updating a database and running on a Window Server I would recommend: 4. Console App (.NET Framework), and in the Application/Properties for the app set the output type to Windows application and this will prevent any type of console window from showing. This is the type of application I use on a frequent basis to accomplish tasks very similar to what you are describing. The security settings you have for the user account logging into the server will determine if you can run it whether the user is logged in or not.

这篇关于简单的无头窗口应用程序的项目类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆