Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I made a service that reads from an .xml file what it needs to ping and then pings that location. What i dont understand is why for service to work i need to put xml file into system32 otherwise it cant see the xml file.

this is the line of code where i specified where the xml resides.

XmlTextReader reader = new XmlTextReader("C:\\Program Files\IDE3 Monitoring Service\KonfiguracijaKlijenta.xml");

tnx in advance
Posted

i need to put xml file into system32 otherwise it cant see the xml file
Sounds like security permissions thing. Try putting it in your other drive or so and allow 'everyone' in security permissions to verify.

Post the error if any you get.
 
Share this answer
 
v2
tnx i'll try that but i have another question..

how can i specify that service looks for my .xml file in the location where user installed this service so i dont need to hard code the path?

for example..user installs this service in c:\program files\blabla..in there there will be my configuration xml file..and what i need is to tell the program to automaticly look for xml in that location for it to read the info it needs becouse the xml file will be in that installation folder..how to pass the path where user choosed to install service to the xml text reader without me knowing what path user choosed?
 
Share this answer
 
v2
Comments
Dragonfly_Lee 22-Aug-10 10:36am    
you can add the path information into the registry and then read it whenever you want.
You should be putting the data file into the appropriate user-specific folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900