在WPF中的消息框上没有得到正确的输出

问题描述:

在我的WPF应用程序中,我有一个MessageBox,应该显示
您的幸运数字是i和j"

(其中i和j是整数类型的局部变量中存在的一些数字)

这是我的代码,

In my WPF application, I have a MessageBox which is supposed to show
"your lucky numbers are i and j"

(where i and j are some numbers present in the local variables of integer type)

This is my code,

MessageBox.Show(string.Format("your lucky numbers are", i + 1, "and", j + 1));




任何帮助将非常感激.感谢




Any help would be much appreciated. thanks

尝试一下:-

Try this:-

MessageBox.Show(string.Format("your lucky numbers are{0} and {1}", (j + 1).ToString(), (i + 1).ToString()));



希望对您有帮助



Hope this helps