private voID SetProgressbar(string text,int position,int max) { try { int percent = (100 * position) / max; //when max is 0 BUG hits string txt = text + String.Format(". {0}%",percent); SetStatus(txt); } catch { } }解决方法
int percent = 0if (max != 0) percent = (100*position) / max总结
以上是内存溢出为你收集整理的c# – 除以零错误,我该如何解决?全部内容,希望文章能够帮你解决c# – 除以零错误,我该如何解决?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)