I ask a question to the user of my application with a MessageBox
using the following code:
var site = Registry.GetValue("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters",
"DynamicSiteName", "Unconnected") as string;
var selectedSite = (Options.GetUserSetting("Site", "SelectedSite"));
if () // Some checks go here
{
DialogResult ret = MessageBox.Show(
string.Format("The selected site is {0}. But you're in {1}...{2}Want to change it ?", selectedSite, site.Trim(), Environment.NewLine),
"Stupid default selection...",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
// Some process goes here
}
The MessageBox
is displayed with the following text:
The selected site is [SelectedSiteNameGoesHere]. But you're in [SiteGoesHere]
which is a bit disturbing because I don't understand why the string is splitted.
If I replace site
with and hard-coded string, the message is displayed normally.
How can I retrieve the missing part?
Edit
Here's the output I have:
And here's the output I want: