Public Static Bool Ismobile (){ String Agent = (httpcontext. Current. Request. useragent + "" ). Tolower (). Trim (); If (Agent = "" | Agent. indexof ( " Mozilla " )! =- 1 | Agent. indexof ( " Opera " )! =- 1 ) Return False ; Return True ;}
Public Bool Iswap (){ String Agent = (request. useragent + "" ). Tolower (). Trim (); If (Agent = "" | Agent. indexof ( " Mobile " )! =- 1 | Agent. indexof ( " MoBi " )! =- 1 | Agent. indexof ( " Nokia " )! =- 1 | Agent. indexof ( " Samsung " )! =- 1 | Agent. indexof ( " Sonyericsson " )! =- 1 | Agent. indexof ( " Mot " )! =- 1 | Agent. indexof ( " Blackberry " )! =- 1 | Agent. indexof ( " LG " )! =- 1 | Agent. indexof ( " HTC " )! =- 1 | Agent. indexof ( " J2EE " )! =- 1 | Agent. indexof ( " Ucweb " )! =- 1 | Agent. indexof ( " Opera mini " )! =- 1 | Agent. indexof ( " MoBi " )! =- 1 ){ // The terminal may be a mobile phone. Return True ;} Return False ;}