创建列表框作业/任务队列 [英] Creating listbox job/task queue

查看:79
本文介绍了创建列表框作业/任务队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

例如我有10个项目的列表框。


如何创建作业队列(自动化)?我使用for each但是经过
处理5件物品后,它就停了,为什么?


谢谢。

Hello,
For example i have listbox with 10 items.

how can i create a job queue (automated)? I used "for each" but after
processing 5 items, it stopped, why?

Thanks.

推荐答案

10月11日上午7:11,kimiraikkonen< kimiraikkone ... @ gmail.comwrote:
On Oct 11, 7:11 am, kimiraikkonen <kimiraikkone...@gmail.comwrote:

你好,

例如我有10个项目的列表框。


如何创建作业队列(自动化)?我使用for each但是经过
处理5件物品后,它就停了,为什么?


谢谢。
Hello,
For example i have listbox with 10 items.

how can i create a job queue (automated)? I used "for each" but after
processing 5 items, it stopped, why?

Thanks.



如果没有向我们展示任何代码,那么诊断

问题就非常困难。我的第一个猜测是你要从foreach循环中删除

列表框中的项目,这将修改枚举器和

导致你只处理其他所有项目。但就像我说的那样,没有

看到你的代码就很难肯定。


谢谢,


Seth Rowe

Without you showing us any code it''s very difficult to diagnose the
problem. My first guess is that you are removing the items from the
listbox in the foreach loop, which will modify the enumerator and
cause you to only process every-other item. But like I said, without
seeing your code it''s difficult to say for sure.

Thanks,

Seth Rowe


嗨塞思,

事实上,我有列表框[我最近开了太多话题] :-)]和

列表框的选定项目是我的外部流程的参数,我想要创建一个批处理列表。处理TILL结束的处理程序

列表框索引NON-STOP /无用户提示。地球上经典批处理的
程序:)


Dim psInfo As New System.Diagnostics.ProcessStartInfo(" external.exe",&br / >
listbox1.selecteditem)

psInfo.WindowStyle =

System.Diagnostics.ProcessWindowStyle.Normal

psInfo.WorkingDirectory = Application。 StartupPath

psInfo.WindowStyle = ProcessWindowStyle.Normal

Dim myProcess As Process =

System.Diagnostics.Process.Start(psInfo)

myProcess.WaitForExit()

如果myProcess.HasExited = True则

尝试

Me.ListBox1.SelectedIndex =

Me.ListBox1.SelectedIndex + 1

System.Diagnostics.Process.Start(" lame.exe","

Catch

MsgBox(所有文件已被转换,

MsgBoxStyle.Information,完成!)

结束尝试

但是正如你在尝试之后看到的那样,程序会处理下一个项目然后它就会停止

停止正常,但我想做一个批处理过程结束

列表框的所有项目。 (所有列表框项目,一个接一个)。


我希望你理解。


非常感谢...

Hi Seth,
In fact, i have listbox [too many topic i'' opened recently :-) ] , and
the selected items of listbox is a parameter of my external process, i
want to create a "batch" processing program which process TILL the end
of listbox index NON-STOP/no user-prompt. Classic batch process of
programs on the earth :)

Dim psInfo As New System.Diagnostics.ProcessStartInfo("external.exe" ,
listbox1.selecteditem)
psInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
psInfo.WorkingDirectory = Application.StartupPath
psInfo.WindowStyle = ProcessWindowStyle.Normal
Dim myProcess As Process =
System.Diagnostics.Process.Start(psInfo)
myProcess.WaitForExit()
If myProcess.HasExited = True Then
Try
Me.ListBox1.SelectedIndex =
Me.ListBox1.SelectedIndex + 1
System.Diagnostics.Process.Start("lame.exe", "
Catch
MsgBox("All files have been converted",
MsgBoxStyle.Information, "Done!")
End Try
But as you see after "try" , the program process the next item then it
stops as normal, but i want to do a batch process TILL the end of
listbox''s ALL items. (all the listbox items, one by one).

I hope you understood.

Very thanks...


kimiraikkonen,


您是否尝试过使用For Next或For Each循环?


Kerry Moorman

" kimiraikkonen"写道:
kimiraikkonen,

Have you tried using a For Next or a For Each loop?

Kerry Moorman
"kimiraikkonen" wrote:

嗨塞思,

事实上,我有列表框[我最近打开了很多主题:-)],

列表框的选定项目是我的外部流程的参数,我想要创建一个批处理工具。处理TILL结束的处理程序

列表框索引NON-STOP /无用户提示。地球上经典批处理的
程序:)


Dim psInfo As New System.Diagnostics.ProcessStartInfo(" external.exe",&br / >
listbox1.selecteditem)

psInfo.WindowStyle =

System.Diagnostics.ProcessWindowStyle.Normal

psInfo.WorkingDirectory = Application。 StartupPath

psInfo.WindowStyle = ProcessWindowStyle.Normal

Dim myProcess As Process =

System.Diagnostics.Process.Start(psInfo)

myProcess.WaitForExit()

如果myProcess.HasExited = True则

尝试

Me.ListBox1.SelectedIndex =

Me.ListBox1.SelectedIndex + 1

System.Diagnostics.Process.Start(" lame.exe","

Catch

MsgBox(所有文件已被转换,

MsgBoxStyle.Information ,完成!

结束尝试


但是正如你所看到的那样尝试 ,程序处理下一个项目然后它

正常停止,但我想做一个批处理TILL结束

列表框'的所有项目。 (所有列表框项目,一个接一个)。


我希望你理解。


非常感谢...

Hi Seth,
In fact, i have listbox [too many topic i'' opened recently :-) ] , and
the selected items of listbox is a parameter of my external process, i
want to create a "batch" processing program which process TILL the end
of listbox index NON-STOP/no user-prompt. Classic batch process of
programs on the earth :)

Dim psInfo As New System.Diagnostics.ProcessStartInfo("external.exe" ,
listbox1.selecteditem)
psInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Normal
psInfo.WorkingDirectory = Application.StartupPath
psInfo.WindowStyle = ProcessWindowStyle.Normal
Dim myProcess As Process =
System.Diagnostics.Process.Start(psInfo)
myProcess.WaitForExit()
If myProcess.HasExited = True Then
Try
Me.ListBox1.SelectedIndex =
Me.ListBox1.SelectedIndex + 1
System.Diagnostics.Process.Start("lame.exe", "
Catch
MsgBox("All files have been converted",
MsgBoxStyle.Information, "Done!")
End Try
But as you see after "try" , the program process the next item then it
stops as normal, but i want to do a batch process TILL the end of
listbox''s ALL items. (all the listbox items, one by one).

I hope you understood.

Very thanks...


这篇关于创建列表框作业/任务队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆