一、遇到的问题
报错:System.ArgumentOutOfRangeException:“提供的行索引超出范围。
如图:
二、解决方法
1:比如一个循环 for (int i = 1; i < list.Count; i++){}
list.Count小于0,这样就会出现索引超出范围,可以在循环上加一个判断if(list.Count > 0){}使用try-catch即可,将异常抛出。
另外一种报错:
附件:
提供其他解决方法:
https://blog.csdn.net/weixin_30488313/article/details/99125132
https://blog.csdn.net/weixin_44684272/article/details/106649746
https://www.thinbug.com/q/5461561