您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP和.NET版客户端信息自动生成_PHP教程

2024/5/15 10:50:46发布39次查看
我使用的是全角,大家修改为半角
不是本人原创
再一些学习教程中大多有简单介绍
.net版本
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,0,0,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(0,0,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版本
http://www.bkjia.com/phpjc/631977.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/631977.htmltecharticle我使用的是全角,大家修改为半角 不是本人原创 再一些学习教程中大多有简单介绍 .net版本 %@page language=c# debug=true% %@import namespace=system%...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product