日期:2014-05-18  浏览次数:20629 次

下面一段ASP获取客户端浏览器信息的代码谁能帮我转成C#的谢谢了!!
'*************************************
'获取客户端浏览器信息
'*************************************
function   getBrowser(strUA)  
  dim   arrInfo,strType,temp1,temp2
  strType= " "
  strUA=LCase(strUA)
  arrInfo=Array( "Unkown ", "Unkown ")
  '浏览器判断
        if   Instr(strUA, "mozilla ")> 0   then   arrInfo(0)= "Mozilla "
        if   Instr(strUA, "icab ")> 0   then   arrInfo(0)= "iCab "
        if   Instr(strUA, "lynx ")> 0   then   arrInfo(0)= "Lynx "
        if   Instr(strUA, "links ")> 0   then   arrInfo(0)= "Links "
        if   Instr(strUA, "elinks ")> 0   then   arrInfo(0)= "ELinks "
        if   Instr(strUA, "jbrowser ")> 0   then   arrInfo(0)= "JBrowser "
        if   Instr(strUA, "konqueror ")> 0   then   arrInfo(0)= "konqueror "
        if   Instr(strUA, "wget ")> 0   then   arrInfo(0)= "wget "
        if   Instr(strUA, "ask   jeeves ")> 0   or   Instr(strUA, "teoma ")> 0   then   arrInfo(0)= "Ask   Jeeves/Teoma "
        if   Instr(strUA, "wget ")> 0   then   arrInfo(0)= "wget "
        if   Instr(strUA, "opera ")> 0   then   arrInfo(0)= "opera "

        if   Instr(strUA, "gecko ")> 0   then  
            strType= "[Gecko] "
            arrInfo(0)= "Mozilla "
            if   Instr(strUA, "aol ")> 0   then   arrInfo(0)= "AOL "
            if   Instr(strUA, "netscape ")> 0   then   arrInfo(0)= "Netscape "
            if   Instr(strUA, "firefox ")> 0   then   arrInfo(0)= "FireFox "
            if   Instr(strUA, "chimera ")> 0   then   arrInfo(0)= "Chimera "
            if   Instr(strUA, "camino ")> 0   then   arrInfo(0)= "Camino "
            if   Instr(strUA, "galeon ")> 0   then   arrInfo(0)= "Galeon "
            if   Instr(strUA, "k-meleon ")> 0   then   arrInfo(0)= "K-Meleon "
            arrInfo(0)=arrInfo(0)+strType
      end   if
     
      if   Instr(strUA, "bot ")> 0   or   Instr(strUA, "crawl ")> 0   then  
            strType= "[Bot/Crawler] "
            arrInfo(0)= " "
            if   Instr(strUA,