11 Mart 2015 Çarşamba

Asp.NET Tarayıcı Bilgisine Ulaşma (Bu bilgiler kesin doğru alınmayabilir.)

sayfanızın görüntülendiği tarayıcıyı belirlemek için
*.aspx.cs dosyası;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; //sisteme ekliyoruz.
protected void Page_Load(object sender, EventArgs e)
{
HttpBrowserCapabilities tarayicibilgisi = Request.Browser;
string name = tarayicibilgisi.Browser;
float version = (float)(tarayicibilgisi.MajorVersion + tarayicibilgisi.MinorVersion);
if (name == “IE” && version >= 7)
{
Response.Write(“IE 7 Kullanılıyor”);
}else if(name == “Firefox” && version >= 2)
{
Response.Write(“Firefox 2 kullanılıyor”);
}
}

Hiç yorum yok :

Yorum Gönder