Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.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# 将字符串、字符类型转换为System.Windows.Forms.Keys_C#_Types_Char_Key - Fatal编程技术网

C# 将字符串、字符类型转换为System.Windows.Forms.Keys

C# 将字符串、字符类型转换为System.Windows.Forms.Keys,c#,types,char,key,C#,Types,Char,Key,我正在尝试将字符转换为System.windows.Form.Keys类型,或将字符串转换为Keys数组。有人知道如何以简单的方式进行吗?数字和大写字母的键与相应的ASCII码匹配。假设您正在处理ASCII,您可以执行以下操作: Keys key = (Keys) (byte) char.ToUpper(c); 数字和大写字母的键代码与相应的ASCII代码匹配。假设您正在处理ASCII,您可以执行以下操作: Keys key = (Keys) (byte) char.ToUpper(c);

我正在尝试将字符转换为System.windows.Form.Keys类型,或将字符串转换为Keys数组。有人知道如何以简单的方式进行吗?

数字和大写字母的
键与相应的ASCII码匹配。假设您正在处理ASCII,您可以执行以下操作:

Keys key = (Keys) (byte) char.ToUpper(c);

数字和大写字母的
代码与相应的ASCII代码匹配。假设您正在处理ASCII,您可以执行以下操作:

Keys key = (Keys) (byte) char.ToUpper(c);

如果不在该范围内,你怎么做?@Geesu,
类型只包含美国键盘上的大写字母和数字。对于不同的键盘布局,非ASCII字符、小写字母和符号会有所不同。如果要使用非ASCII字母,则需要使用其他字母。如果不在该范围内,如何执行此操作?@Geesu,
类型仅包含美国键盘上的大写字母和数字。对于不同的键盘布局,非ASCII字符、小写字母和符号会有所不同。如果要使用非ASCII字母,则需要使用其他字母。