如何在 UWP 中使用 System.Console [英] How to use System.Console in UWP

查看:26
本文介绍了如何在 UWP 中使用 System.Console的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 UWP 中使用 windows 控制台.我知道有 System.Diagnostic.Debug 但它只为我提供了在 Windows 控制台中显示消息的方法,我想从控制台读取.

I want to use windows console in UWP. I know that there is System.Diagnostic.Debug but it provides me only methods to display message in windows console and I want to read from the console.

推荐答案

System.Console 不适用于 UWP 应用.如果要创建控制台应用程序,请使用 .NET Framework 或 .NET Core,而不是通用 Windows 平台.System.Diagnostics.Debug 类仅用于调试目的,用户看不到其输出.

System.Console is not available for UWP apps. If you want to create console app, use .NET Framework or .NET Core not Universal Windows Platform. The System.Diagnostics.Debug class is just for debugging purposes and users don't see its output.

但是,在 UWP 应用中获取用户输入的方法还有很多,例如 TextBox.

However there are many other ways how to get user's input in UWP app, for example TextBox.

这篇关于如何在 UWP 中使用 System.Console的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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