at TextEditor.PixelMap.Set(Boolean b,Int32 x,Int32 y)in c:\users \< my name> \documents\visual studio 2010 \Projects\TextEditor \ TextEditor\TextEditor.cs:第127行 at C:\users \< my name> \documents\visual studio 2010中的TextEditor.PixelMap..ctor(图片图片) \\ Projects \TextEditor\TextEditor\TextEditor.cs:第109行 at c:\users \< my name> \中的TextEditor.PixelMap..ctor(字符串路径) documents \ visual studio 2010 \Projects\TextEditor\TextEditor \TextEditor.cs:第92行 at c:\users \< my name> \documents\visual studio 2010 \Projects中的TextEditor.Character.FromImageSimple(Char letter) \TextEditor\TextEditor\TextEditor.cs:第220行 at TextEditor.Character..cctor()in c:\users \< my name> \documents\visual studio 2010 \Projects\TextEditor\TextEditor\TextEditor.cs:第247行 InnerException:推荐答案查看内部异常的堆栈跟踪: 字符的静态构造函数类调用 FromImageSimple 方法; FromImageSimple 创建一个新的 PixelMap 实例; PixelMap 构造函数调用 Set(bool,int,int),它在同一个类上调用索引器; PixelMap的索引器 cl屁股试图将一个值放入一个索引太大或太小的数组中;Look at the stack-track of the inner exception:The static constructor of your Character class calls the FromImageSimple method;FromImageSimple creates a new PixelMap instance;The PixelMap constructor calls Set(bool, int, int), which calls the indexer on the same class;The indexer of the PixelMap class is trying to put a value into an array at an index which is either too large or too small; InnerException:System.IndexOutOfRangeException 消息=索引超出了数组的范围。 TextEditor.cs:第138行 查看列表或数组结构。也许这就是你的问题。InnerException: System.IndexOutOfRangeExceptionMessage=Index was outside the bounds of the array.TextEditor.cs:line 138take a look at list or array-like structures. Perhaps thats your issue. 这篇关于我不知道我是如何得到类型初始化异常的!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-20 15:16