本文介绍了发送系统信息运行我的asp.net表单或单击按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HELLO

如何通过asp.net语言捕获(获取)systeminfo。

按一下asp格式的按钮并在其中编写代码,

当用户点击它时将她的系统信息发送到我的服务器。

系统信息(如cpu 2.4 -hdd 500g -ram 2ddr3 -main ASUS Monitor Acer 15&...)。



通过



源代码或运行语法或组件来做到这一点





plase将aswer副本发送到我的邮箱:azeran2010@yahoo.com

thanks



[edit]永远不要在任何论坛发布您的电子邮件地址,除非您真的喜欢垃圾邮件!如果有人回复你,你会收到一封电子邮件让你知道 - OriginalGriff [/ edit]

HELLO
how can i catch(get) systeminfo by asp.net language.
put a button in asp form and write a code in it,
when user click on it send her system info to my server.
system info(like cpu 2.4 -hdd 500g -ram 2ddr3 -main ASUS Monitor Acer 15 &...).

do that by

source code or run a syntax or a component


plase send a copy of aswer to my email:azeran2010@yahoo.com
thanks

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know - OriginalGriff[/edit]

推荐答案


private string SystemInformation()
 {
     StringBuilder StringBuilder1 = new StringBuilder(string.Empty);
     try
     {
         StringBuilder1.AppendFormat("Operation System: {0}<br />", Environment.OSVersion);
         if (Environment.Is64BitOperatingSystem)
             StringBuilder1.AppendFormat("64 Bit Operating System<br />");
         else
             StringBuilder1.AppendFormat("32 Bit Operating System<br />");
         StringBuilder1.AppendFormat("SystemDirectory: {0}<br />", Environment.SystemDirectory);
         StringBuilder1.AppendFormat("ProcessorCount: {0}<br />", Environment.ProcessorCount);
         StringBuilder1.AppendFormat("UserDomainName: {0}<br />", Environment.UserDomainName);
         StringBuilder1.AppendFormat("UserName: {0}<br />", Environment.UserName);
                     //Drives
         StringBuilder1.AppendFormat("LogicalDrives:<br />");
         foreach (System.IO.DriveInfo DriveInfo1 in System.IO.DriveInfo.GetDrives())
         {
             try
             {
                 StringBuilder1.AppendFormat("Drive: {0}<br />VolumeLabel: {1}<br />DriveType: {2}<br />DriveFormat: {3}<br />TotalSize: {4}<br />AvailableFreeSpace: {5}<br />",
                     DriveInfo1.Name, DriveInfo1.VolumeLabel, DriveInfo1.DriveType, DriveInfo1.DriveFormat, DriveInfo1.TotalSize, DriveInfo1.AvailableFreeSpace);
             }
             catch
             {
             }
         }
         StringBuilder1.AppendFormat("SystemPageSize: {0}<br />", Environment.SystemPageSize);
         StringBuilder1.AppendFormat("Version: {0}", Environment.Version);
     }
     catch
     {
     }
     return StringBuilder1.ToString();
 }



最常用的方法是使用java脚本,例如你可以使用这段代码找出分辨率他/她的电脑:


The most commonly used method to do this is to use java script, for example you can use this code to find out resolution of his/her computer:

<script type="text/javascript">
    // get width of scree
    document.write(screen.width);
    // get height of screen
    document.write('*');
    document.write(screen.height);
</script>





您可以使用JavaScript收集一些有价值的信息,例如用户的IP或用户的位置等。只需搜索Google和你会发现很多这些有用的Java脚本。您还可以使用其他.NET类来执行此操作,例如,查找可以使用的客户端的IP:



You can use JavaScript to collect some valuable information such as user’s IP or location of user etc. Just search Google and you will find plenty of this useful Java Scripts. You can also use other .NET classes to do this, for example for finding IP of client you can use:

Request.UserHostAddress

Request.ServerVariables["REMOTE_ADDR"].ToString()

或显示客户端上一个链接到您可以使用的网页的请求的URL Request.UrlReferrer

or to show URL of the client''s previous request that linked to your webpage you can use Request.UrlReferrer.


这篇关于发送系统信息运行我的asp.net表单或单击按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 13:47