@using Microsoft.Extensions.DependencyModel @using ZoomLaCMS.Resources @functions{ public string ServerName() { var psi = new System.Diagnostics.ProcessStartInfo("hostname"); psi.RedirectStandardOutput = true; using (var process = System.Diagnostics.Process.Start(psi)) { var computerName = process.StandardOutput.ReadToEnd(); return computerName; } } public string NetCoveVersion() { //.NETCoreApp,Version=v2.0 string verStr= DependencyContext.Default.Target.Framework; if (verStr.Contains("=")) { return verStr.Split('=')[1].ToUpper(); } else { return verStr; } } } @{ //launchSettings.json // var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); }
| @L.浏览器版本: | |
| @L.服务器名: | @System.Environment.MachineName |
| @L.服务器系统: | @System.Environment.OSVersion.VersionString |
| @L.服务器IP: | @Context.Connection.LocalIpAddress |
| @L.目录: | @System.Environment.CurrentDirectory |
| @L.客户端地址: | @Context.Connection.RemoteIpAddress.ToString() |
| .NET @L.版本: | @NetCoveVersion() |