一个应用程序的多个实例 [英] Multiple instances of an application

查看:241
本文介绍了一个应用程序的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,程序员!
在我的应用程序中,我正在根据以前记录的数据进行仿真.记录的数据文件位于一个文件夹中,例如Folder_A.现在,我想启动Folder_A中的文件一样多的应用程序实例.
以前,我将单个文件传递给应用程序以进行单凝胶模拟.很简单,但现在启动的应用程序实例与Folder-A中的文件一样多.每个实例执行一个文件.
例如应用程序"myapplication"需要使用两个不同的实例同时模拟fileA和FileB.
任何帮助或建议,将不胜感激.
谢谢

我尝试过的事情:

以前我在做单个文件.

Hello programmers!!
In my application I am doing simulation from previously logged data. Logged data files are in one folder e.g Folder_A. Now I want to start as much instance of application as much files are in the Folder_A.
Previous i was passing single file to application for singel simulation. Was easy but now start as much instance of application as many files are in Folder-A. Each instance execute one of the file.
e.g. Applicaion "myapplication" need to simulate fileA and FileB at same time with two different instances.
Any help or suggestion would be appreciated.
Thanks

What I have tried:

previously i was doing with single file. it was easy one file one instance.

推荐答案

只需编写一个可完成此任务的命令/批处理文件:
Just write a command / batch file that does the job:
rem Start application for each file in specific directory
echo off
for %%i in (data_file_path\*) do app_path_and_name "%%i"


这里的data_file_path是数据文件的完整路径,而app_path_and_name是应用程序的完整路径和名称.请注意,当它们包含空格时,必须用双引号引起来.

要测试将执行什么操作,只需在do之后插入echo命令:


Here data_file_path is the full path to your data files and app_path_and_name is the full path and name of your application. Note that these must be enclosed by double quotes when they contain spaces.

To test what would be done just insert an echo command after do:

rem Start application for each file in specific directory
echo off
for %%i in (data_file_path\*) do echo app_path_and_name "%%i"




要了解FOR命令,请打开命令提示符窗口并键入




To know about the FOR command, open a command prompt window and type

help for


[/EDIT]


[/EDIT]


这篇关于一个应用程序的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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