Sniffing visitor information

Collecting lots of browser information from the visitor with VB .NET in ASP .NET.

Any website that generates a decent traffic needs a statistic page. So how do you collect statistics?
ASP .NET knows how to sniff some information from the visitor, from basic information like the browser version to information about the support of Java Applets and ActiveX Controls.

The following is VB .NET code for displaying client information with ASP .NET:

<%
response.write("<b>Name:</b> " & Request.ServerVariables("REMOTE_HOST") & "<br />")
response.write("<b>IP:</b> " & Request.ServerVariables("REMOTE_ADDR") & "<br />")
response.write("<b>User agent:</b> " & Request.ServerVariables("HTTP_USER_AGENT") & "<br />")
response.write("<b>Language:</b> " & Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") & "<br />")
response.write("<b>Browser:</b> " & Request.Browser.Browser & "<br />")
response.write("<b>Type:</b> " & Request.Browser.Type & "<br />")
response.write("<b>Version:</b> " & Request.Browser.Version & "<br />")
response.write("<b>Major version:</b> " & Request.Browser.MajorVersion & "<br />")
response.write("<b>Minor version:</b> " & Request.Browser.MinorVersion & "<br />")
response.write("<b>Beta:</b> " & Request.Browser.Beta & "<br />")
response.write("<b>Cookies:</b> " & Request.Browser.Cookies & "<br />")
response.write("<b>Frames:</b> " & Request.Browser.Frames & "<br />")
response.write("<b>Tables:</b> " & Request.Browser.Tables & "<br />")
response.write("<b>ActiveX:</b> " & Request.Browser.ActiveXControls & "<br />")
response.write("<b>Java Applets:</b> " & Request.Browser.JavaApplets & "<br />")
response.write("<b>JavaScript:</b> " & Request.Browser.JavaScript & "<br />")
response.write("<b>VBScript:</b> " & Request.Browser.VBScript & "<br />")
response.write("<b>Platform:</b> " & Request.Browser.Platform & "<br />")
response.write("<b>Crawler:</b> " & Request.Browser.Crawler & "<br />")
%>

Here is a sample result:

Name: geekpedia
IP: 127.0.0.1
User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
Language: en-us
Browser: IE
Type: IE6
Version: 6.0
Major version: 6
Minor version: 0
Beta: False
Cookies: True
Frames: True
Tables: True
ActiveX: True
Java Applets: True
JavaScript: True
VBScript: True
Platform: WinXP
Crawler: False

Nathan Pakovskie is an esteemed senior developer and educator in the tech community, best known for his contributions to Geekpedia.com. With a passion for coding and a knack for simplifying complex tech concepts, Nathan has authored several popular tutorials on C# programming, ranging from basic operations to advanced coding techniques. His articles, often characterized by clarity and precision, serve as invaluable resources for both novice and experienced programmers. Beyond his technical expertise, Nathan is an advocate for continuous learning and enjoys exploring emerging technologies in AI and software development. When he’s not coding or writing, Nathan engages in mentoring upcoming developers, emphasizing the importance of both technical skills and creative problem-solving in the ever-evolving world of technology. Specialties: C# Programming, Technical Writing, Software Development, AI Technologies, Educational Outreach

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top