看看这代码,为什么LABEL不能直接显示变量文本?
我按书的步骤去做,为什么LABEL2.还是不能显示?代码如下 Dim sysinfo As String
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
sysinfo += Environment.MachineName & Environment.NewLine
sysinfo += Environment.UserName & Environment.NewLine
sysinfo += Environment.GetFolderPath(Environment.SpecialFolder.System) & Environment.NewLine
sysinfo += Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & Environment.NewLine
sysinfo += Environment.OSVersion.Version.ToString() & Environment.NewLine
sysinfo += Environment.TickCount & "毫秒" & Environment.NewLine
sysinfo += TimeZone.CurrentTimeZone.StandardName & Environment.NewLine
sysinfo += Environment.NewLine
Dim envvar As Collections.DictionaryEntry
For Each envvar In Environment.GetEnvironmentVariables()
sysinfo += envvar.Key & ":`" & envvar.Value & Environment.NewLine
Next
Label2.Text = sysinfo
End Sub