Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Monday, February 27, 2012

How to detect MSISDN from browser headers

        How to detect MSISDN from browser headers  
        Things to note be remember that:  
        1.If the user has come to wap portal on WiFi then you will not receive msisdn.  
        2.User mobile operator has to support the passing of the msisdn in the HTTP      headers.  
                  
        Below is simple code to find msisdn from header.  
                  
        string[] strHeader = Request.Headers.AllKeys;  
       string strMSISDN="";  
       for (int i = 0; i < strHeader.Length; i++)  
       {  
         if (strHeader[i].Contains("msisdn") || strHeader[i].ToLower().StartsWith("msisdn", StringComparison.CurrentCultureIgnoreCase) ||strHeader[i].ToLower().EndsWith("msisdn", StringComparison.CurrentCultureIgnoreCase) ||strHeader[i].ToLower().StartsWith("mdn", StringComparison.CurrentCultureIgnoreCase) ||strHeader[i].ToLower().EndsWith("mdn", StringComparison.CurrentCultureIgnoreCase) ||)  
         {  
           strMSISDN = Request.Headers[strHeader[i]];  
   
           if (strMSISDN.Length >= 15)  
           {  
             for (int j = 0; j < strHeader.Length; j++)  
             {  
               if (strHeader[j].ToLower().StartsWith("mdn", StringComparison.CurrentCultureIgnoreCase) || strHeader[j].ToLower().EndsWith("mdn", StringComparison.CurrentCultureIgnoreCase))  
               {  
                 strMSISDN = Request.Headers[strHeader[j]];  
                 break;  
               }  
             }  
           }  
           else  
           {  
             break;  
           }  
         }  
       }  
   
 Thanks & Regards  
 Santosh  

1 comment:

  1. This is an amazing blog,it gives very helpful messages to us.Besides that Wisen has established as Best Dot Net Training in Chennai. or learn thru ASP.NET Online Training . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete