如何在 C# 控制台应用程序中绘制方框、矩形
我问2个相关问题。
1-我们如何将输出(例如结果和消息)放入 ac# 控制台应用程序的框中。
2-我们如何在 ac# 控制台应用程序中绘制矩形。感谢您提供任何示例教程或建议
I ask for 2 related questions.
1-How we can Put outputs(such as Results and Messages) inside a box in a c# console application.
2-How we can draw rectangle in a c# console application.thank u for any sample tutorial or advice
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设你只是指一个字符框,这就可以了。
我编辑了代码以在其中添加一条消息。您需要在边界条件上做更多的工作。例如,消息中没有空格,单词比框长,但这应该足以让您开始。
Assuming you just meant a character box this will do it.
I edited the code to put a message in their. You will need to do more work on the boundary conditions. Ex no space in the message a word that is longer then the box but this should be enough to get you started.
C# 有 curses 绑定(这可能是一个好的开始):http://curses-sharp.sourceforge.net/
There are curses bindings for C# (that might be a good start): http://curses-sharp.sourceforge.net/
如果您想自己编写,您可以使用扩展的ascii代码在控制台中绘制简单的形状。 扩展 AScii 表
If you want to write it by yourself, You can use extended ascii code to draw simple shapes in a console. Extended AScii Table