0

我有一个标签和这个代码:

            string User = Environment.UserName;
        toolStripStatusLabel1.Text = "This Software is Licensed to:" + User;

由于某种原因,输出是:

This Software is Licensed to:UserName
4

2 回答 2

3

非常简单的修复:

string User = Environment.UserName;
toolStripStatusLabel1.Text = "This Software is Licensed to: " + User;
// Add a space after 'to:'

希望这可以帮助!

于 2012-06-30T02:36:19.573 回答
1

尝试在“:”之后插入一个空格

于 2012-06-30T02:41:26.920 回答