Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.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# 什么';内容值、字体和unicode在这方面有什么进展_C#_Css_Asp.net_Font Awesome - Fatal编程技术网

C# 什么';内容值、字体和unicode在这方面有什么进展

C# 什么';内容值、字体和unicode在这方面有什么进展,c#,css,asp.net,font-awesome,C#,Css,Asp.net,Font Awesome,角色类型有问题 protected void Page_Load(object sender, EventArgs e) { char test = '\ue900'; //This makes test = 59648'.' } 但是,这不起作用: protected void Page_Load(object sender, EventArgs e) { char test = '\f000'; //This won't compile becau

角色类型有问题

protected void Page_Load(object sender, EventArgs e)
{
    char test = '\ue900'; //This makes test = 59648'.'
}
但是,这不起作用:

protected void Page_Load(object sender, EventArgs e)
{        
    char test = '\f000'; 
    //This won't compile because squiggly on test says "Too many characters in literal"        
    //However, this works when I put the value in CSS content attribute.
}

如何使后者适合测试变量?我认为在第一个示例中,它是一个unicode值,而在第二个示例中它不是?

我认为\f是表单提要,因此它的后缀超出了单个字符文本的范围。

\u
是在c#中指定unicode字符的表示法。
\u
后面跟着一个十六进制值,更详细


所以第一个代码是编译的,因为您指定了一个字符,但在第二个代码中,您有4个字符,它们是
\f
转义序列和三个零。这就是它无法编译的原因。

您是否尝试过
“\f000”
?我认为,由于该字符是2个字节,您应该使用“可能与您期望的'f000'表示的内容重复”来表示?c#支持以
'\u'
开头的,它支持以
'\x'
开头的。其中一个示例位于上。“\f000”是来自FontAwesome的内容值。