473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

can i put 2 configuration files for my Console application ?

Hi all,

I want to give a sample console application for the user with 2
configuration files.
I want to give also a 2 .bat files for running the sample application, one
for each configuration file.
How can i choose in the .bat file which configuration file to use ?
(something like myApp.exe -D file1.config).

Thanks.

Dec 27 '05 #1
6 1432
if you are asking about command parameter value then use %1 as variable.

I could not get teh correct link but this link do have some examples that
will give you some idea.

http://www.microsoft.com/technet/arc...ain/batch.mspx
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
Hi all,

I want to give a sample console application for the user with 2
configuration files.
I want to give also a 2 .bat files for running the sample application, one
for each configuration file.
How can i choose in the .bat file which configuration file to use ?
(something like myApp.exe -D file1.config).

Thanks.

Dec 27 '05 #2
i don't know how to run myApp.exe once with file1.config and once with
file2.config as the configuration file (without copying file1.config or
file2.config to myApp.exe.config).
"Pohihihi" wrote:
if you are asking about command parameter value then use %1 as variable.

I could not get teh correct link but this link do have some examples that
will give you some idea.

http://www.microsoft.com/technet/arc...ain/batch.mspx
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
Hi all,

I want to give a sample console application for the user with 2
configuration files.
I want to give also a 2 .bat files for running the sample application, one
for each configuration file.
How can i choose in the .bat file which configuration file to use ?
(something like myApp.exe -D file1.config).

Thanks.


Dec 27 '05 #3
no you can't do that. but what you can do is that you can change the name of
config file to run with another config file.
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
i don't know how to run myApp.exe once with file1.config and once with
file2.config as the configuration file (without copying file1.config or
file2.config to myApp.exe.config).
"Pohihihi" wrote:
if you are asking about command parameter value then use %1 as variable.

I could not get teh correct link but this link do have some examples that
will give you some idea.

http://www.microsoft.com/technet/arc...ain/batch.mspx
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
> Hi all,
>
> I want to give a sample console application for the user with 2
> configuration files.
> I want to give also a 2 .bat files for running the sample application,
> one
> for each configuration file.
> How can i choose in the .bat file which configuration file to use ?
> (something like myApp.exe -D file1.config).
>
> Thanks.
>


Dec 27 '05 #4
don't understand you, please give an example for your solution.

Thanks.
"Pohihihi" wrote:
no you can't do that. but what you can do is that you can change the name of
config file to run with another config file.
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
i don't know how to run myApp.exe once with file1.config and once with
file2.config as the configuration file (without copying file1.config or
file2.config to myApp.exe.config).
"Pohihihi" wrote:
if you are asking about command parameter value then use %1 as variable.

I could not get teh correct link but this link do have some examples that
will give you some idea.

http://www.microsoft.com/technet/arc...ain/batch.mspx
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
> Hi all,
>
> I want to give a sample console application for the user with 2
> configuration files.
> I want to give also a 2 .bat files for running the sample application,
> one
> for each configuration file.
> How can i choose in the .bat file which configuration file to use ?
> (something like myApp.exe -D file1.config).
>
> Thanks.
>


Dec 27 '05 #5
When you compile your application you get a config file with the name of exe
file and config as extension (assuming you have added app.config in your
project). now you can have 2 files wiht different settings e.g.

1- application.exe.config
2- application.exe.config.notinuse

now when you have to use config file #2 then you can change the name of #1
to something like application.exe.config.notinusenow and you can change the
#2 as application.exe.config

now when you will run your application #2 config file will be used.
other way could be that you read second config file (which is nothing more
than xml file) and using xml features in language you can read the tags and
values. little involved process but might work for the settings you are
needing.

just wondering, what is the diff between two files youhave?
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
don't understand you, please give an example for your solution.

Thanks.
"Pohihihi" wrote:
no you can't do that. but what you can do is that you can change the name
of
config file to run with another config file.
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
>i don't know how to run myApp.exe once with file1.config and once with
> file2.config as the configuration file (without copying file1.config or
> file2.config to myApp.exe.config).
>
>
> "Pohihihi" wrote:
>
>> if you are asking about command parameter value then use %1 as
>> variable.
>>
>> I could not get teh correct link but this link do have some examples
>> that
>> will give you some idea.
>>
>> http://www.microsoft.com/technet/arc...ain/batch.mspx
>>
>>
>> "yaron" <ya***@discussions.microsoft.com> wrote in message
>> news:33**********************************@microsof t.com...
>> > Hi all,
>> >
>> > I want to give a sample console application for the user with 2
>> > configuration files.
>> > I want to give also a 2 .bat files for running the sample
>> > application,
>> > one
>> > for each configuration file.
>> > How can i choose in the .bat file which configuration file to use ?
>> > (something like myApp.exe -D file1.config).
>> >
>> > Thanks.
>> >
>>
>>
>>


Dec 27 '05 #6
ok, got you, i hope that there was other option like myApp.exe -D file1.config.

Thanks a lot.
"Pohihihi" wrote:
When you compile your application you get a config file with the name of exe
file and config as extension (assuming you have added app.config in your
project). now you can have 2 files wiht different settings e.g.

1- application.exe.config
2- application.exe.config.notinuse

now when you have to use config file #2 then you can change the name of #1
to something like application.exe.config.notinusenow and you can change the
#2 as application.exe.config

now when you will run your application #2 config file will be used.
other way could be that you read second config file (which is nothing more
than xml file) and using xml features in language you can read the tags and
values. little involved process but might work for the settings you are
needing.

just wondering, what is the diff between two files youhave?
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
don't understand you, please give an example for your solution.

Thanks.
"Pohihihi" wrote:
no you can't do that. but what you can do is that you can change the name
of
config file to run with another config file.
"yaron" <ya***@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
>i don't know how to run myApp.exe once with file1.config and once with
> file2.config as the configuration file (without copying file1.config or
> file2.config to myApp.exe.config).
>
>
> "Pohihihi" wrote:
>
>> if you are asking about command parameter value then use %1 as
>> variable.
>>
>> I could not get teh correct link but this link do have some examples
>> that
>> will give you some idea.
>>
>> http://www.microsoft.com/technet/arc...ain/batch.mspx
>>
>>
>> "yaron" <ya***@discussions.microsoft.com> wrote in message
>> news:33**********************************@microsof t.com...
>> > Hi all,
>> >
>> > I want to give a sample console application for the user with 2
>> > configuration files.
>> > I want to give also a 2 .bat files for running the sample
>> > application,
>> > one
>> > for each configuration file.
>> > How can i choose in the .bat file which configuration file to use ?
>> > (something like myApp.exe -D file1.config).
>> >
>> > Thanks.
>> >
>>
>>
>>


Dec 27 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alexander Kienzle | last post by:
I'm new to Java programming. I'm developing a Servlet for tomcat which needs an external configuration file. With external I mean a file (in XML format) which is customizable and not contained in...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
7
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include...
5
by: Arsalan Ahmad | last post by:
Hi all, I am developing a simple one page application in ASP.NET which takes an input in a text box and print in a label. But when i uploaded it to the website i get the following error: ...
3
by: Cacho | last post by:
Hi All I'm totally new to vbasic net and need to get values from a config files in the way: <configuration> <appSettings> <add key="Desvio" value="652825616" /> <add key="MargenString"...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
0
by: leung.cheung | last post by:
Any suggestions for the follwing senario: I have created a console application that take State name as input. Each state has its own settings, and that settings are set by local administrator of...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
5
by: Author | last post by:
This may sound like a silly question. I rarely do console or windows form applications. In a console application, I have an XML configuration file. I place it under my application root. In...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.