Can I use a variable in an app.config file?

J

jabailo

I have the config file below.

Is there anyway for the value of MachineName to be populated,
automatically, with the IP address that the application is running on?

So, I would say something like machineName=@IPAddress or some such thing...




<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="ChatCenter, ChatCenter"
url="http://192.168.1.59:8080/Chat"
/>
</client>
<channels>
<!-- The "0" port is declared to allow remoting to choose -->
<!-- the most appropriate channel. You must specify a
channel -->
<!-- here, however; if you do not do so, your ChatClient -->
<!-- will not be listening for the call back from the -->
<!-- ChatCoordinator object. -->
<channel
ref="http"
port="0"
machineName="192.168.1.172">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top