0
我很接近完成我的程序,但我有一个问题。 无论如何,我可以暂停循环,直到播放Windows Media Player中的所有文件。 像处理例如:等到Windows Media Player结束为止?
process.WaitForExit();
while (!process.HasExited)
Thread.Sleep(500);
代码:
private bool listbox3job()
{
AxWMPLib.AxWindowsMediaPlayer axWmp =
wfh.Child as AxWMPLib.AxWindowsMediaPlayer;
DateTime? start = starttid2.Value;
DateTime? end = sluttid2.Value;
DateTime now = DateTime.Now;
if (start == null || end == null)
{
}
else if (now >= start.Value && now <= end.Value)
{
while (DateTime.Now < end.Value) // Loops till DateEndTime.
{
foreach (var selected in listBox3.Items) // Each file in ItemList.
{
string s = selected.ToString();
if (listBox3Dict.ContainsKey(s))
{
axWmp.URL = (listBox3Dict[s]); //Where all WMP files starts
}
}
}
return true;
}
return false;
}
任何??真的需要这个帮助。 – Sneakybastardd