-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: spprivate
Message 3 in Discussion

Hi  For Doing in ASP I use this component (attached).U can use it. One way of doing 
this is ASP.NET is like this.Here I render the service of a free website which has a 
huge collection of data . HTH Cheers Satheesh   ************************ ASP 
********************** regsvr32 ip2location.dll    *********************** <% 
   ' Create server-side object 
   Set ipObj = Server.CreateObject("IP2Location.Country") 
    
   ' Initialize IP2Location object 
   If ipObj.Initialize("demo") <> "OK" Then 
       response.write "IP2Location Initialization Failed. 
   End If 
    
   ' Get visitor's IP address 
   IPaddr = Request.ServerVariables("REMOTE_ADDR") 

   ' Detect visitor's country of origin by IP address 
   CountryName = ipObj.LookUpShortName(IPaddr) 
    
   ' Free IP2Location object     
   Set ipObj = nothing 
    
   If CountryName = "JP" Then 
       ' Visitor is from Japan 
       ' Redirect the URL to index_jp.htm 
       Response.Redirect "index_jp.htm" 
   Else 
       ' Visitor is not from Japan 
       ' Redirect the URL to index_en.htm 
       Response.Redirect "index_en.htm" 
   End If 
%> 

 ************************************** ASP.NET *************************************  
Dim wc As New System.Net.WebClient() 
Dim html As String = 
Encoding.ASCII.GetString(wc.DownloadData("http://www.showmyip.com/?ip="; & 
request.ServerVariables("REMOTE_ADDR") )) 
Dim SerProvider1 
Dim SerProvider2 
Dim SerProvider3 
Dim SerProviderCountry1 
Dim SerProviderCountry2 
Dim SerProviderCountry3 
SerProvider1 = InStr(html, "Query IP Host:") 
SerProvider2 = InStr(SerProvider1 + Len("Query IP Host:") + 11, html, "</FONT>") 
SerProvider3 = Mid(html, SerProvider1 + Len("Query IP Host: </FONT><FONT face=Arial>") 
+ 2, (SerProvider2 - SerProvider1) - Len("Query IP Host: </FONT><FONT face=Arial>") - 
2) 
SerProviderCountry1 = InStr(html, "Query IP Country:") 
SerProviderCountry2 = InStr(SerProviderCountry1 + Len("Query IP Country:") + 14, html, 
"</FONT>") 
SerProviderCountry3 = Mid(html, SerProviderCountry1 + Len("Query IP Country: 
</FONT><FONT face=Arial>") + 2, (SerProviderCountry2 - SerProviderCountry1) - 
Len("Query IP Country: </FONT><FONT face=Arial>") - 2) 
'SerProviderCountry3 = Left(SerProviderCountry3, Len(SerProviderCountry3) - 14) 
'SerProviderCountry3 = Right(SerProviderCountry3, Len(SerProviderCountry3) - 6)
View Attachment(s):
http://groups.msn.com/bdotnet/_notifications.msnw?type=msg&mview=1&parent=1&item=13590
-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to