Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 未在windows窗体中查看欧元符号_C#_.net_Winforms_Euro - Fatal编程技术网

C# 未在windows窗体中查看欧元符号

C# 未在windows窗体中查看欧元符号,c#,.net,winforms,euro,C#,.net,Winforms,Euro,我正在尝试使用以下代码在Windows窗体应用程序中打印欧元符号。 它适用于所有其他字符和符号,但不显示欧元 string input = ((char)128).ToString(); Font f = new System.Drawing.Font("Arial", 12f); Graphics gr = this.CreateGraphics(); gr.DrawString(input, f, Brushes.Black, new PointF(0, 0)); 128-是欧元符号的小数

我正在尝试使用以下代码在Windows窗体应用程序中打印欧元符号。 它适用于所有其他字符和符号,但不显示欧元

string input = ((char)128).ToString();
Font f = new System.Drawing.Font("Arial", 12f);
Graphics gr = this.CreateGraphics();
gr.DrawString(input, f, Brushes.Black, new PointF(0, 0));
128-是欧元符号的小数点
有人能帮忙吗?

128不是表示欧元符号的正确值。也许可以试试:

string input = ((char)0x20AC).ToString();

因为U+20AC是欧元符号的Unicode代码点。

通过使用下面的代码,我实现了在不使用Unicode的情况下打印欧元符号

String input = Encoding.Default.GetString(new byte[] { 128 });
Font f = new System.Drawing.Font("Arial", 12f);
Graphics gr = this.CreateGraphics();
gr.DrawString(input, f, Brushes.Black, new PointF(0, 0));

这可能会对某些人有所帮助。

您是如何或在哪里确定128是欧元符号的正确值的?@the_Cthulhu_Kid:对不起,我没有听到您的问题。请尝试字符串输入=\u20A0//20AC@Damien_不信教者:如果我给131,我得到F符号,如果我给130,我得到逗号符号,但欧元不起作用。尝试8364而不是128。谢谢朋友,但我需要解释一下,如果我把130放在那里,我得到那个特殊的符号,为什么没有128?@kovilpattiCsharper-从你链接的页面上,对于128-255:8位ASCII表有几种不同的变体。下表符合ISO 8859-1,也称为ISO拉丁语-1。代码129-159包含Microsoft®Windows Latin-1扩展字符。因此,ASCII值有几种不同的可能性。而且它们与unicode不匹配,如果您想在.NET中提供数值,就应该使用unicode。谢谢