LCID or country

M

Miguel Orrego

Hi,

Does anybody know how to determine a user's country or LCID in an asp page?

I've found some articles on using:
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")

but somehow this doesn't seem like a foolproof method to me.

Thanks.
 
E

Egbert Nierop \(MVP for IIS\)

Miguel Orrego said:
Hi,

Does anybody know how to determine a user's country or LCID in an asp page?

I've found some articles on using:
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")

but somehow this doesn't seem like a foolproof method to me.

It is not foolproof indeed. It's the only best way SET by the user himself!
Some others use IP address recognition (country based) but you should not
insult a user by guessing his preference language based on IP.
 
M

Miguel Orrego

I agree about not insulting users, however my exercise has nothing to do
with language.

It is an intranet site where PC engineers can go and download software
packages for the PC's they are working on. There are different packages
depending on country (The applications are packaged to connect to different
servers etc). Therefore it would be nice to get the LCID of the requesting
PC so that they are pointed to the correct package (With the choice there to
change if need be obviously).

I appreciate this may be impossible, but if anybody knows a way that would
be great.

Thanks again.
 
E

Evertjan.

Miguel Orrego wrote on 16 dec 2003 in
microsoft.public.inetserver.asp.general:
It is an intranet site where PC engineers can go and download software
packages for the PC's they are working on. There are different
packages depending on country (The applications are packaged to
connect to different servers etc). Therefore it would be nice to get
the LCID of the requesting PC so that they are pointed to the correct
package (With the choice there to change if need be obviously).

I appreciate this may be impossible, but if anybody knows a way that
would be great.

If you want the clientside LCID you are off topic on this NG.

btw see: GetUserDefaultLCID()

<http://msdn.microsoft.com/library/en-us/intl/nls_08tg.asp>
 
E

Egbert Nierop \(MVP for IIS\)

Miguel Orrego said:
I agree about not insulting users, however my exercise has nothing to do
with language.

It is an intranet site where PC engineers can go and download software
packages for the PC's they are working on. There are different packages
depending on country (The applications are packaged to connect to different
servers etc). Therefore it would be nice to get the LCID of the requesting
PC so that they are pointed to the correct package (With the choice there to
change if need be obviously).

I appreciate this may be impossible, but if anybody knows a way that would
be great.
As Evertjan said use clientside script It must be vbscript to return that


<FORM method="post" method="yourpage.asp" id="myForm" name="myForm">
<INPUT TYPE="hidden" name="lcid" value="" id="myId">
</FORM>

<script language=vbscript>
myForm.myId.value = GetLocale()
myForm.submit(); ' have the code run to the server!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top