I am using 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