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
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-06-05 广告
2023-06-05 广告
StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,IP...
点击进入详情页
本回答由Storm代理提供
展开全部
自己筛选吧,这是我一个页面所获得电脑的一些信息的方法,我就不给你一个一个找了 你慢慢试 肯定能实现你的需求
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;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询