- Machine(Name) : A100007()
- OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2
- No. of Processors: 4
- Uptime: 11 days, 1 hours, 55 minutes
- User Domain Name: HOME
- Interactive User: True
- Username() : mark.smith()
ASP.NET: Environment Details
From Wiki
Summary: An example of how to view details of the web servers environment
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Dim sb As New StringBuilder
- sb.AppendLine("Machine Name: " & Environment.MachineName & "<br>")
- sb.AppendLine("OS Version: " & Environment.OSVersion.VersionString & "<br>")
- sb.AppendLine("No. of Processors: " & Environment.ProcessorCount & "<br>")
- sb.AppendLine("Uptime: " & TimeSpan.FromMilliseconds(Environment.TickCount).Days & " days, ")
- sb.AppendLine(TimeSpan.FromMilliseconds(Environment.TickCount).Hours & " hours, ")
- sb.AppendLine(TimeSpan.FromMilliseconds(Environment.TickCount).Minutes & " minutes<br>")
- sb.AppendLine("User Domain Name: " & Environment.UserDomainName & "<br>")
- sb.AppendLine("Interactive User: " & Environment.UserInteractive & "<br>")
- sb.AppendLine("Username: " & Environment.UserName & "<br>")
- Label1.Text = sb.ToString
- End Sub
Output:
This Hack is part of the ASP.NET Hacks collection


