One way to define those values that are pseudo-hardcoded – like a server’s IP address – is to place this in the project setting configuration file.
This is retrieved from the project’s settings:
When saved, these settings are placed in a configuration file. There are actually two files: app.config (which is found with the source code) and <exe>.config – which is found in the bin/debug directory.
Now, to retrieve these settings, its as simple as using the Properties namespace, which are available at runtime:
sMsgqIP = TestReadXml.Properties.Settings.Default.msgqIP;
N.B.: TestReadXml is the project name