Is it possible to get a copyright symbol in C# Console application?(是否可以在 C# 控制台应用程序中获得版权符号?)
问题描述
是否可以在 C# 控制台应用程序中以任何方式添加版权符号或其他特殊"符号?
Is it possible to add a copyright symbol or other "special" symbol in any way in a C# console application?
推荐答案
namespace test {
class test {
public static void Main() {
System.Console.WriteLine("©");
}
}
}
完美地为我工作.无论控制台窗口设置为光栅字体还是 Unicode.
works for me flawlessly. Regardless of whether the console window is set to raster fonts or Unicode.
如果要输出 Unicode,应将控制台输出编码设置为 UTF-8 或 Unicode.
If you want to output Unicode, you should set the console output encoding to UTF-8 or Unicode.
System.Console.OutputEncoding = System.Text.Encoding.UTF8;
或
System.Console.OutputEncoding = System.Text.Encoding.Unicode;
如果你想清楚源代码编码问题,你应该直接指定字符代码点:
And if you want to stay clear from source code encoding issues you should specify the character code point directly:
System.Console.WriteLine("u00a9");
这篇关于是否可以在 C# 控制台应用程序中获得版权符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以在 C# 控制台应用程序中获得版权符号?


基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01