开发者

Display Computer Info on an ASP.NET Page

I want to build a page for end users to visit (in our MPLS Network) and it show the following information in regards to them:

  • Computer Name
  • OS
  • Disk Space
  • Memory
  • IP Address
  • Active Directory User Name
  • Password Expiration Time (As defined by Global Policy)

Maybe a few other things such as Trend Micro Office current version vs. their version, # of MS Updates needed (we utilize WSUS), and a few other things in the future.

My question is how would I pull this information from the user when they visit the page? What is the pro开发者_高级运维per function for this? Anyone have examples they wish to share for me to learn by if possible?


You won't be able to show all of this using C#. C# is a server side language and therefore, only has access to that information relative to the server it's being hosted on. You might be able to access this information from a java applet that runs on the page in the user's browser, but I'm not sure. There are usually security restrictions involved.


If you allow your web page to gather all this information about your users, what's to stop some other web page from doing the same?


So it's in an intranet only? You could use the client computers IP address (as reported by the Request.UserHostAddress) and then query your domain controller for the information (via the DomainController class and the collections/methods it exposes).

Most of the information you're after will be available via the Domain Controller, and some of the others can be retrieved by using remote performance counters (for example, you could query for free disk space using the LogicalDisk\% Free Space counter).


You cannot do this without writing a browser plug-in or a java applet.

The information is not available through javascript, and it's not in the headers sent by the browser. This is by design, for security reasons.

Edit This answer only applies to public pages; I see from subsequent comments that it will be intranet-only.


You might want to look at XAML Browser Applications (XBAP). It's similar in a way to Silverlight except you get the advantages of the full .Net framework. To be able to access some local resources you would need to use the trust mode as explained below.

WPF XAML Browser Applications Overview

Creating a Full Trust .xbap Application

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜