PHP and. NET client information automatically generated _ PHP Tutorial

Source: Internet
Author: User
Tags servervariables
PHP and. NET client information is automatically generated. I am using Quanjiao. I am not an original speaker. I will give a brief introduction to some tutorials. NET version % @ PageLanguageC # Debugtrue % @ ImportnamespaceSystem % I am using the fullwidth. you can change it to halfwidth.
Not original
I will give a brief introduction to some tutorials.

. NET version


<% @ Page Language = "C #" Debug = "true" %>
<% @ Import namespace = "System" %>
<% @ Import namespace = "System. Drawing" %>
<% @ Import namespace = "System. IO" %>
<%
String sReferer = Request. ServerVariables ["HTTP_REFERER"];
String sLanguage, sBrowser, sSys;
If (Request. ServerVariables ["HTTP_ACCEPT_LANGUAGE"]. IndexOf ("zh-cn")> = 0 ){
SLanguage = "Chinese ";
}
Else
{
SLanguage = Request. ServerVariables ["HTTP_ACCEPT_LANGUAGE"];
}
String [] aUserAgent = Request. ServerVariables ["HTTP_USER_AGENT"]. Split (';');
If (aUserAgent. Length> 2 ){
SBrowser = aUserAgent [1]. Replace ("MSIE", "Internet Explorer"). Trim ();
If (sBrowser = "U "){
SBrowser = "Mozilla ";
}
SSys = aUserAgent [2]. Replace (")","");
SSys = sSys. Replace ("NT 5.2", "2003 ");
SSys = sSys. Replace ("NT 5.1", "XP ");
SSys = sSys. Replace ("NT 5.0", "2000 ");
SSys = sSys. Replace ("9x", "Me"). Trim ();
}
Else
{
SBrowser = "Unknown ";
SSys = "Unknown ";
}
Int nWidth = 260, nHeight = 90;
Bitmap image = new Bitmap (nWidth, nHeight );
Graphics g = Graphics. FromImage (image );
Stream imgData = new MemoryStream ();
G. Clear (Color. Snow );
G. DrawRectangle (Pens. Black, nWidth-1, nHeight-1 );
G. drawString ("Your IP:" Request. serverVariables ["REMOTE_ADDR"], new Font ("Courier New", 9, FontStyle. bold), new SolidBrush (Color. fromArgb (200, 14, 91), 6, 6 );
G. drawString ("Language:" sLanguage, new Font ("Courier New", 9, FontStyle. bold), new SolidBrush (Color. fromArgb (0, 0, 0), 6, 26 );
G. drawString ("Your OS:" sSys, new Font ("Courier New", 9, FontStyle. bold), new SolidBrush (Color. fromArgb (255,), 6, 46 );
G. drawString ("Browser:" sBrowser, new Font ("Courier New", 9, FontStyle. bold), new SolidBrush (Color. fromArgb (0,160, 0), 6, 66 );
G. Dispose ();
Response. ContentType = "image/gif ";
Image. Save (Response. OutputStream, System. Drawing. Imaging. ImageFormat. Gif );
%>
PHP version

Ghost is not my original. in some more tutorials, I will briefly introduce. NET version % @ Page Language = C # Debug = true % @ Import namespace = System %...

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.