A piece of asp code for collecting host information

Source: Internet
Author: User
Tags servervariables

I need to collect information on some hosts. I have seen many of my friends write similar code before. Unfortunately, I can't find it and I can't write it on my own. It's mainly about collecting target systems and browsers, the Code is as follows:

<%
Testfile = Server. MapPath ("createfile. dat ")
Ip = request. ServerVariables ("REMOTE_ADDR ")
Httpheader = Request. ServerVariables ("Http_User_Agent ")
Mytime = now ()
Set fs = server. CreateObject ("scripting. filesystemobject ")
Set thisfile = fs. OpenTextFile (testfile, 8, True, 0)
Thisfile. WriteLine ("ip:" & ip)
Thisfile. WriteLine ("time:" & mytime)
Thisfile. WriteLine ("header:" & httpheader)
Thisfile. WriteLine ("---------------------------------------")
Thisfile. close
Set fs =
Nothing
%>

Why not use javascript? In fact, it is very simple, mainly considering that IE8 has other partial browser to intercept these requests and prompts the user to execute these scripts. Isn't that a dead end? Use asp to replace it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.