473,785 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1450
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***@discussi ons.microsoft.c om> wrote in message
news:33******** *************** ***********@mic rosoft.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.confi g).
"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***@discussi ons.microsoft.c om> wrote in message
news:33******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:32******** *************** ***********@mic rosoft.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.confi g).
"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***@discussi ons.microsoft.c om> wrote in message
news:33******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:32******** *************** ***********@mic rosoft.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.confi g).
"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***@discussi ons.microsoft.c om> wrote in message
news:33******** *************** ***********@mic rosoft.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.notinus e

now when you have to use config file #2 then you can change the name of #1
to something like application.exe .config.notinus enow 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***@discussi ons.microsoft.c om> wrote in message
news:82******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:32******** *************** ***********@mic rosoft.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.confi g).
>
>
> "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***@discussi ons.microsoft.c om> wrote in message
>> news:33******** *************** ***********@mic rosoft.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.notinus e

now when you have to use config file #2 then you can change the name of #1
to something like application.exe .config.notinus enow 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***@discussi ons.microsoft.c om> wrote in message
news:82******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:32******** *************** ***********@mic rosoft.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.confi g).
>
>
> "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***@discussi ons.microsoft.c om> wrote in message
>> news:33******** *************** ***********@mic rosoft.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
8683
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 my package. I don't want to hardcode any path and I would like to be independent of the application server (tomcat, websphere,...). Until now, I put the file in my package and open it using obj.getClass.getResourceAsStream but when I put my...
3
2882
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 applications and web services without having to use the machine.config file. I know that I could use the code below to do this but the problem then becomes that when using a shared assembly both the assembly and the config file need to be put...
7
5987
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 are like a root directory for a target program on the user's machine my app uses, which they would be prompted to supply at startup. Normally the registry is used for this but I'd rather not use the registry if possible. Isn't there some kind of...
5
1612
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: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
3
1474
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" value="10" /> </appSettings>
7
22498
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 added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
0
1135
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 each state. How do I use multiple .config files for a signle application? When the application loads, I want to point it to use a configuration file that in the subfolder for each state, and use the settings from the .config file.
7
10828
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 code. The configuration section is contained within the exe (it's a simple test case!) and everything works well debugging within the IDE or if the application is deployed on a drive or share that has been granted full trust. For the share the...
5
2085
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 my code, I also say string configFilePath = "./configuration.xml"; When I debug the application with VS 2005, I get an error which says
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.