The best way to do this is to create the string before-hand, and use that string in the Console.WriteLine and the MessageBox.Show().

ie:

Code:
string myString = "foobar";
Console.WriteLine(myString);
MessageBox.Show(myString, ...);
To keep the formatting of your string, you can do:

Code:
int myInt = 1;
string myString = string.Format("Foobar: {0}", myInt);
Console.WriteLine(myString);
MessageBox.Show(myString, ...);