我有以下C#代码 -ASCII.GetBytes在switch语句错误 - 无法转换对象类型
switch (Convert.ToInt32(Encoding.ASCII.GetBytes(grdGrading.Text.Trim())))
grdGrading
是一个数据网格。
我目前得到这个错误 - Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.
是什么原因造成的任何想法?