Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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")

  • *Experts*
Posted

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>

Printer Monitor for .NET? - see Merrion Computing Ltd for details
  • 1 month later...
Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...