NetTalk Central

Author Topic: Get the User-Agent info  (Read 3544 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Get the User-Agent info
« on: July 29, 2010, 10:31:29 PM »
Hallo,


How can I get the User-Agent info ? like bellow

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8


Thank you,
Robert

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Get the User-Agent info
« Reply #1 on: July 30, 2010, 06:32:20 AM »
Robert,

The web handler's "_useragent" property contains that information.

Larry Sand

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Re: Get the User-Agent info
« Reply #2 on: August 02, 2010, 10:34:31 AM »
Hallo Larry,


I found that property too, but don't know how to use it... and where to put the code...

Thank you,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Get the User-Agent info
« Reply #3 on: August 03, 2010, 07:25:41 AM »
use it wherever you need to. I guess where depends on what you're doing with it.
as to "how"...

str = p_web._UserAgent

Cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Re: Get the User-Agent info
« Reply #4 on: August 03, 2010, 10:07:12 PM »
Hallo Bruce,

I always got compile error: Syntax error: Field not found: _USERAGENT

Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Get the User-Agent info
« Reply #5 on: August 04, 2010, 05:40:38 AM »
what build are you using?

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Re: Get the User-Agent info
« Reply #6 on: August 04, 2010, 06:23:58 AM »
Version 4.49

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Re: Get the User-Agent info
« Reply #7 on: August 10, 2010, 07:51:31 AM »
Hallo Bruce,

Any news ?

Thank you,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Get the User-Agent info
« Reply #8 on: August 10, 2010, 08:09:21 PM »
ah - you may want to mention the version you have with your posts. The _UserAgent property is in version 5.

you'll need to do this;

xxx = p_web.GetHeaderField('User-Agent:')

cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
    • Email
Re: Get the User-Agent info
« Reply #9 on: August 15, 2010, 04:11:26 AM »
Hallo Bruce,

Works perfect!
Thanks