Hai All
How to check server pc or client pc when using web site ? in page load event i need to check server pc or client pc,if it server pc i enable textbox and label,if not i disable textbox and label,
need to check in 3 condition in a link
1.with ip address like http://192.168.0.4/web/login.aspx
2.with localhost like http://localhost/web/login.aspx
3.with machine name like http://admin-PC/web/login.aspx
in above 3 condition,it will wotk on localhost basis and code is
Dim CLIENTIP As String = String.Empty
CLIENTIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If CLIENTIP = "" Then
CLIENTIP = Request.ServerVariables("REMOTE_ADDR")
End If
If (CLIENTIP = "::1") Then
txtBrowseFolder.Enabled = True
btnwatchpath.Enabled = True
Else
txtBrowseFolder.Enabled = False
btnwatchpath.Enabled = False
End If
the above correctly work if it use localhost in an a link,if it is ip address or machine name not work.
note : pls think client server machinsim
publish copy available in server system,if anybody open link need to check whether client or server pc,if it server pc enable controls it not disable controls.
Pls reply me asap
Regards
Aravind