LCID or country

Discussion in 'ASP General' started by Miguel Orrego, Dec 16, 2003.

  1. 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.
     
    Miguel Orrego, Dec 16, 2003
    #1
    1. Advertising

  2. "Miguel Orrego" <-nospam> wrote in message
    news:3fdee36a$0$25672$...
    > 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.

    > Thanks.
    >
     
    Egbert Nierop \(MVP for IIS\), Dec 16, 2003
    #2
    1. Advertising

  3. 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.


    "Egbert Nierop (MVP for IIS)" <> wrote in message
    news:OLv#...
    > "Miguel Orrego" <-nospam> wrote in message
    > news:3fdee36a$0$25672$...
    > > 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.
    >
    > > Thanks.
    > >

    >
     
    Miguel Orrego, Dec 16, 2003
    #3
  4. Miguel Orrego

    Evertjan. Guest

    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>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Dec 16, 2003
    #4
  5. "Miguel Orrego" <-nospam> wrote in message
    news:3fdf17ab$0$25671$...
    > 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!
    </script>

    > Thanks again.
    >
    >
    > "Egbert Nierop (MVP for IIS)" <> wrote in message
    > news:OLv#...
    > > "Miguel Orrego" <-nospam> wrote in message
    > > news:3fdee36a$0$25672$...
    > > > 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.
    > >
    > > > Thanks.
    > > >

    > >

    >
    >
     
    Egbert Nierop \(MVP for IIS\), Dec 16, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Clive
    Replies:
    1
    Views:
    652
    John Saunders
    Aug 28, 2003
  2. S.Guhananth
    Replies:
    1
    Views:
    551
    Alvin Bruney [Microsoft MVP]
    Apr 30, 2005
  3. ubi_comp
    Replies:
    0
    Views:
    2,246
    ubi_comp
    Feb 3, 2006
  4. Zyron
    Replies:
    2
    Views:
    1,509
    Jukka K. Korpela
    Nov 8, 2005
  5. Petr Janda
    Replies:
    2
    Views:
    161
    rretzbach
    Mar 8, 2007
Loading...

Share This Page