2个回答
展开全部
1. 在ASP.NET中专用属性:
获取服务器电脑名:Page.Server.ManchineName
获取用户信息:Page.User
获取客户端电脑名:Page.Request.UserHostName
获取客户端电脑IP:Page.Request.UserHostAddress
2. 在网络编程中的通用方法:
获取当前电脑名:static System.Net.Dns.GetHostName()
根据电脑名取出全部IP地址:static System.Net.Dns.Resolve(电脑名)。AddressList
也可根据IP地址取出电脑名:static System.Net.Dns.Resolve(IP地址)。HostName
3. 系统环境类的通用属性:
当前电脑名:static System.Environment.MachineName
当前电脑所属网域:static System.Environment.UserDomainName
当前电脑用户:static System.Environment.UserName
获取服务器电脑名:Page.Server.ManchineName
获取用户信息:Page.User
获取客户端电脑名:Page.Request.UserHostName
获取客户端电脑IP:Page.Request.UserHostAddress
2. 在网络编程中的通用方法:
获取当前电脑名:static System.Net.Dns.GetHostName()
根据电脑名取出全部IP地址:static System.Net.Dns.Resolve(电脑名)。AddressList
也可根据IP地址取出电脑名:static System.Net.Dns.Resolve(IP地址)。HostName
3. 系统环境类的通用属性:
当前电脑名:static System.Environment.MachineName
当前电脑所属网域:static System.Environment.UserDomainName
当前电脑用户:static System.Environment.UserName
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
快又稳
2024-10-28 广告
2024-10-28 广告
广州快又稳网络科技有限公司是一家集技术研发、产品创新、服务优化于一体的高新技术企业。公司自成立以来,始终秉承“网络使人类缩进距离,我们让网络快又稳”的核心理念,致力于为全球客户提供高效、安全、易用的互联网解决方案及信息技术服务。在数字时代,...
点击进入详情页
本回答由快又稳提供
展开全部
自己筛选吧,这是我一个页面所获得电脑的一些信息的方法,我就不给你一个一个找了 你慢慢试 肯定能实现你的需求
lbServerName.Text = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
lbIp.Text = Request.ServerVariables["LOCAl_ADDR"];
lbDomain.Text = Request.ServerVariables["SERVER_NAME"].ToString();
lbPort.Text = Request.ServerVariables["Server_Port"].ToString();
lbIISVer.Text = Request.ServerVariables["Server_SoftWare"].ToString();
lbPhPath.Text = Request.PhysicalApplicationPath;
lbOperat.Text = Environment.OSVersion.ToString();
lbSystemPath.Text = Environment.SystemDirectory.ToString();
lbTimeOut.Text = (Server.ScriptTimeout / 1000).ToString() + "秒";
lbLan.Text = CultureInfo.InstalledUICulture.EnglishName;
lbAspnetVer.Text = string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, Environment.Version.Build, ".", Environment.Version.Revision });
lbCurrentTime.Text = DateTime.Now.ToString();
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Version Vector");
lbIEVer.Text = key.GetValue("IE", "未检测到").ToString();
lbServerLastStartToNow.Text = ((Environment.TickCount / 0x3e8) / 60).ToString() + "分钟";
string[] achDrives = Directory.GetLogicalDrives();
for (int i = 0; i < Directory.GetLogicalDrives().Length - 1; i++)
{
lbLogicDriver.Text = lbLogicDriver.Text + achDrives[i].ToString();
}
//ManagementClass diskClass = new ManagementClass("NUMBER_OF_PROCESSORS");
lbCpuNum.Text = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString();
lbCpuType.Text = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString();
lbMemory.Text = (Environment.WorkingSet / 1024).ToString() + "M";
lbMemoryPro.Text = ((Double)GC.GetTotalMemory(false) / 1048576).ToString("N2") + "M";
lbMemoryNet.Text = ((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M";
lbCpuNet.Text = ((TimeSpan)Process.GetCurrentProcess().TotalProcessorTime).TotalSeconds.ToString("N0");
lbSessionNum.Text = Session.Contents.Count.ToString();
lbSession.Text = Session.Contents.SessionID;
lbUser.Text = Environment.UserName;
lbServerName.Text = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
lbIp.Text = Request.ServerVariables["LOCAl_ADDR"];
lbDomain.Text = Request.ServerVariables["SERVER_NAME"].ToString();
lbPort.Text = Request.ServerVariables["Server_Port"].ToString();
lbIISVer.Text = Request.ServerVariables["Server_SoftWare"].ToString();
lbPhPath.Text = Request.PhysicalApplicationPath;
lbOperat.Text = Environment.OSVersion.ToString();
lbSystemPath.Text = Environment.SystemDirectory.ToString();
lbTimeOut.Text = (Server.ScriptTimeout / 1000).ToString() + "秒";
lbLan.Text = CultureInfo.InstalledUICulture.EnglishName;
lbAspnetVer.Text = string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, Environment.Version.Build, ".", Environment.Version.Revision });
lbCurrentTime.Text = DateTime.Now.ToString();
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Version Vector");
lbIEVer.Text = key.GetValue("IE", "未检测到").ToString();
lbServerLastStartToNow.Text = ((Environment.TickCount / 0x3e8) / 60).ToString() + "分钟";
string[] achDrives = Directory.GetLogicalDrives();
for (int i = 0; i < Directory.GetLogicalDrives().Length - 1; i++)
{
lbLogicDriver.Text = lbLogicDriver.Text + achDrives[i].ToString();
}
//ManagementClass diskClass = new ManagementClass("NUMBER_OF_PROCESSORS");
lbCpuNum.Text = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString();
lbCpuType.Text = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString();
lbMemory.Text = (Environment.WorkingSet / 1024).ToString() + "M";
lbMemoryPro.Text = ((Double)GC.GetTotalMemory(false) / 1048576).ToString("N2") + "M";
lbMemoryNet.Text = ((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M";
lbCpuNet.Text = ((TimeSpan)Process.GetCurrentProcess().TotalProcessorTime).TotalSeconds.ToString("N0");
lbSessionNum.Text = Session.Contents.Count.ToString();
lbSession.Text = Session.Contents.SessionID;
lbUser.Text = Environment.UserName;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询