Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a business requirement to develop an ASP.Net application which would be hosted on Web server and application would run on only on those pc's which are allowed to access that application. The requirement is to bind a number of pc's which will be in various branch offices only those can access application. I don't have any static IP's or specified users, only the requirement is to bind the application with PC's. I have only the machines information which is provided to me. How could i get the machine specific information from ASP.Net and verify it? Which approach i should have to follow, looking for suggestions. Thanks in advance...
Posted
Updated 13-Sep-11 20:23pm
v2

You can get the client information from the Request object like this :
C#
Request.ServerVariables["REMOTE_HOST"]
Request.ServerVariables["REMOTE_ADDR"]


And to get the hostname :
C#
System.Net.Dns.GetHostEntry(Request.ServerVariables["REMOTE_ADDR"]).HostName
 
Share this answer
 
Comments
Ashwani Dhiman 14-Sep-11 3:00am    
Hi, thanks for reply.

I'm looking for machine specific information like mac ID etc. How could i get machine specific info and verify it from asp.net. thanks...
Ashwani Dhiman 14-Sep-11 3:01am    
with out the use of ActiveXobjects....
Mehdi Gholam 14-Sep-11 3:57am    
That is very hard if near impossible to do without some sort of client side native code execution.
Ashwani Dhiman 14-Sep-11 4:21am    
Which client side native code execution you would suggest? And How to communicate between client side application and Asp.Net application? any idea....
Mehdi Gholam 14-Sep-11 4:29am    
Personally I would not do this and would change my strategy as there are too many parameters out of my control which would render getting the information undependable.
if you are into a network domain use the Active directory users and make the website authentication to Windows. so it will take care all instead of writing the code.. otherwise you have to handle manually...

Provide more details about the eenvironment...
 
Share this answer
 
Comments
Ashwani Dhiman 14-Sep-11 2:46am    
There is not any domain only the pc's connected to switch to modems which does not have any static IP, working on dynamic IP. If check for the address of its returns only the dynamic IP . I have to go for Mac ID etc. to verify a pc. The server variables are not full filling the requirement. How could i get machine specific info and verify it from asp.net. thanks...
you can see the server veriables from the below url

A list of Request Objects (server variables)[^]

ASP.NET cannot get all the information from the client due to security..

what you can do is,you can have a admin windows ui to setup the permission. also you can use some cookies (have to write one cookie in each client) to verify those at run time... But this you have to do in the each client machine, also don't clear the cookies...
 
Share this answer
 
This is not possible for a pure in browser web application: websites are not permitted to access details about the computer they're on, and for good reason. (It is possible with an ActiveX control or browser extension, but that is really bad user experience and you should not do it.)

You should either: (a) use normal user/role based authentication as is typical for websites, and give a user name to each branch; or (b) have the computers that are special on a VPN and restrict access to 'local' (i.e. on network) by hosting this web app on a server that is not externally visible.

This 'business requirement' sounds like something dreamt up by a manager who wants to feel important and doesn't actually know what he's requiring. Exercise all possible pressure to get it removed and to be allowed to talk to the people who will actually use the app and find out what the requirement really is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900