안녕하세요 여기에 코드입니다.
# region /////Split Users List in 3 Parts////
ArrayList thList1 = new ArrayList();
ArrayList thList2 = new ArrayList();
ArrayList thList3 = new ArrayList();
ArrayList thListId1 = new ArrayList();
ArrayList thListId2 = new ArrayList();
ArrayList thListId3 = new ArrayList();
int countList = arlistuid.Count/3;
int count;
for (count = 0; count < arlistuid.Count; count++)
{
if (count < countList)
{
thList1.Add(arlistuid[count]);
thListId1.Add(arlistid[count]);
}
else if (count >= countList && (count < countList + countList))
{
thList2.Add(arlistuid[count]);
thListId2.Add(arlistid[count]);
}
else
{
thList3.Add(arlistuid[count]);
thListId3.Add(arlistid[count]);
}
}
# endregion
# region ///Send Email using 3 threads
if (thList1.Count > 0)
{
object thdargs = new object[2] { thList1, thListId1 };
Thread thd1 = new Thread(new ParameterizedThreadStart(SplitListEmail));
thd1.IsBackground = true;
thd1.Name = "Thread1";
thd1.Start(thdargs);
}
if (thList2.Count > 0)
{
object thd2args = new object[2] { thList2, thListId2 };
Thread thd2 = new Thread(new ParameterizedThreadStart(SplitListEmail));
thd2.IsBackground = true;
thd2.Name = "Thread2";
thd2.Start(thd2args);
}
if (thList3.Count > 0)
{
object thd3args = new object[2] { thList3, thListId3 };
Thread thd3 = new Thread(new ParameterizedThreadStart(SplitListEmail));
thd3.IsBackground = true;
thd3.Name = "Thread3";
thd3.Start(thd3args);
}
# endregion
오류가 있습니까? –
어쩌면 당신은 smtp를 정의 할 필요가 있을까요? –
오류, 스크린 샷, 코드? 더 나은 시나리오를 설명하십시오. –