NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Robert Iliuta on July 29, 2010, 10:31:29 PM

Title: Get the User-Agent info
Post by: Robert Iliuta 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
Title: Re: Get the User-Agent info
Post by: Larry Sand on July 30, 2010, 06:32:20 AM
Robert,

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

Larry Sand
Title: Re: Get the User-Agent info
Post by: Robert Iliuta 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
Title: Re: Get the User-Agent info
Post by: Bruce 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
Title: Re: Get the User-Agent info
Post by: Robert Iliuta on August 03, 2010, 10:07:12 PM
Hallo Bruce,

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

Robert
Title: Re: Get the User-Agent info
Post by: Bruce on August 04, 2010, 05:40:38 AM
what build are you using?
Title: Re: Get the User-Agent info
Post by: Robert Iliuta on August 04, 2010, 06:23:58 AM
Version 4.49
Title: Re: Get the User-Agent info
Post by: Robert Iliuta on August 10, 2010, 07:51:31 AM
Hallo Bruce,

Any news ?

Thank you,
Robert
Title: Re: Get the User-Agent info
Post by: Bruce 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
Title: Re: Get the User-Agent info
Post by: Robert Iliuta on August 15, 2010, 04:11:26 AM
Hallo Bruce,

Works perfect!
Thanks