是否可以在 C# 控制台应用程序中获得版权符号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/644785/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to get a copyright symbol in C# Console application?
提问by Patrik Bj?rklund
Is it possible to add a copyright symbol or other "special" symbol in any way in a C# console application?
是否可以在 C# 控制台应用程序中以任何方式添加版权符号或其他“特殊”符号?
采纳答案by Joey
namespace test {
class test {
public static void Main() {
System.Console.WriteLine("?");
}
}
}
works for me flawlessly. Regardless of whether the console window is set to raster fonts or Unicode.
完美地为我工作。无论控制台窗口设置为光栅字体还是 Unicode。
If you want to output Unicode, you should set the console output encoding to UTF-8 or Unicode.
如果要输出 Unicode,则应将控制台输出编码设置为 UTF-8 或 Unicode。
System.Console.OutputEncoding = System.Text.Encoding.UTF8;
or
或者
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");
回答by Mark Ingram
You can copy it from here if you like:
如果您愿意,可以从这里复制它:
?
?
(You can hold down ALT, then type 0169, then release the ALT key)
(你可以按住ALT,然后输入0169,然后松开ALT键)
回答by PHeiberg
Console.WriteLine("?");
works for me...
对我有用...
Or isn't it output you're after?
或者它不是你想要的输出?
回答by BuddyJoe
How about holding down ALt and typing 0169 to get the copyright symbol.
如何按住 ALT 键并输入 0169 以获取版权符号。
static void Main(string[] args)
{
Console.Write("?");
}
回答by Anton Litvinov
The best copyright symbol that you can get:
您可以获得的最佳版权符号:
Console.WriteLine("(c)");