Dictionary<string, string> dicPZ = new Dictionary<string, string>();
int ZZS = int.Parse(this.txtTotalNum.Text);
int ZHS = int.Parse(this.txtHNum.Text);
if (ZZS==0)
{
XtraMessageBox.Show("总幢数为0");
return;
}
int x = (ZZS) / (checkUsernameList.Count);
int y = (ZZS) % (checkUsernameList.Count);
for (int k = 0; k < checkUsernameList.Count; k++)
{
for (int j = 0; j < x; j = j + x)
{
dicPZ.Add(listZH[k*x+j], checkUsernameList[k]);
}
}
for (int k = 0; k < y; k++)
{
if (x==0)
{
dicPZ.Add(listZH[k], checkUsernameList[k]);
}
else
{
dicPZ.Add(listZH[checkUsernameList.Count * x - 1 + k], checkUsernameList[k]);
}
}