Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read ini file for Windows Service

Status
Not open for further replies.

k1Ll5w1tcH

Programmer
Jul 29, 2008
9
ZA
Howzit

I've written a windows service app, which needs to read an ini file. When I read the file I get no result, no errors and only "". When I run it in a windows forms app, it works fine.
Is there something I'm missing??

Please help me out guys!

P.S. The file is on the local disk and the SYSTEM account has full control of the file.
 
It sounds like a permission problem.

I don't know the code fragment you are using, but if there's an error, have you tried logging the error to a log file or the event viewer? I've written many a Windows Service and I always make sure I keep good logs since you can't quite debug as well.
 
go and write debugger.Laucher() on start
to debug your service application.
seems like permission issue to me.
 
I didn't have this problem. So, it should work in your case.

You might want to check the file path if that's the case. Usually, when debugging, I had it spit out to the log file so I can see what's going on behind the scene since I'm not able to do the debugger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top