473,469 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

alternative to .ini file to store file locations in Windows Service

I just need a simple code snippet to read from a config file the file
locations needed for my Windows Service. Sort of like web.config but
since this is a Windows Service, I won't be using that.

Nov 23 '05 #1
1 2604
You can create and a App.Config file in a Windows Service project but as I
have not actually tried wirking with it, I cannot be sure that it actually
works.

The App.Config file is structured like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="FilePath" value="C:\Path\" />
</appSettings>
</configuration>

And is accessed as follows:
Configuration.ConfigurationSettings.AppSettings("F ilePath")

"ia*******@gmail.com" wrote:
I just need a simple code snippet to read from a config file the file
locations needed for my Windows Service. Sort of like web.config but
since this is a Windows Service, I won't be using that.

Nov 23 '05 #2

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

Similar topics

20
by: Sushil | last post by:
Hi gurus I was reading FAQ "alloca cannot be written portably, and is difficult to implement on machines without a conventional stack." I understand that the standard does not mandate...
5
by: SP | last post by:
Please advice. I am not familiar with the concepts of windows service. I am trying to access a xml configuration file from windows service. But it is failing. configuration file is in the same...
4
by: sysdeamon | last post by:
Hi, i am new to Visual C#. i am trying to develop a file searcher utility similar to that of Windows own 'Search for files and folder' for desktop. i want to know is there a method that can...
2
by: Andy Johns | last post by:
I've seen plenty of examples of file uploads in ASP.NET when the only form element is the file input type, but I've not seen a practical example of a file upload routine running alongside other...
2
by: Kev | last post by:
Hi guys I have a console application that calls a web service. This app uses a config file to store certain settings I want to be able to store the web service providers hostname in the config...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
3
by: Crash | last post by:
VS 2003 ..NET 1.x Windows 2000 SP4 Hi all, We recently migrated a data center containing several database and ASP web service servers. We have a Windows Forms application that runs on 200+...
8
by: baker_tony | last post by:
Hi, is there any way of getting details (such as last modified/created date/time) of a file located on the web? E.g I'd like to know when the file "http://www.myWebSite.com/ update.txt" was last...
6
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
The same error messages full out the application event log. --- "The open procedure for service "ASP.NET" in DLL "C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll" failed. Performance...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.