int macNumber = macNumber2 - macNumber1 - 1; //此处macNumber=2; for (a = 9; a <= number; a++)
{
if (0 == macNumber--)
{
break; //执行2次后,便退出for循环,当然也不执行else,但是为什么还执行呢?
}
else
{
ptr = Marshal.ReadIntPtr(p, a * Marshal.SizeOf(ptr));
sss[a] = Marshal.PtrToStringAnsi(ptr);
msg += sss[a] + "\r\n";
}
}
{
break; //执行2次后,便退出for循环,当然也不执行else,但是为什么还执行呢?
}
执行了两次else语句后,就会退出了。。除非你else语句里头用了递归的方法。