mtbballer Posted September 29, 2003 Posted September 29, 2003 I have compiled a simple application (host & client) that allows me to control my windows media player with my pocket PC. In the application, the port number is hardcoded into the program. How do I setup and import a configuration file that will allow me to modify this port number without having to recode and recompile the program? (i.e. a flat file that has an entry like "soapport=9000") Quote
*Experts* Merrion Posted September 29, 2003 *Experts* Posted September 29, 2003 You need to create a configuration file in XML. The file is exename.config i.e. for a program called woof it would be called woof.exe.config The gubbins goes in: <configuration> <appSettings> <!-- Your settings go here... --> </appSettings> </configuration> Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
manana Posted November 17, 2003 Posted November 17, 2003 My woof.exe.config (for woof.exe) is located in the bin folder. Everytime I run or compile the project, the file disappears. In addition, the appSettings values return "" (no error). Are there any obscure settings that control this? Quote
*Experts* Merrion Posted November 17, 2003 *Experts* Posted November 17, 2003 The VS IDE takes any file in your project called App.config and copies it into the \bin directory as ecename.exe.config when you compile a project. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.