Sunday, August 31, 2014

How to get the user-agent with C#?

Hi All,


I have a question about how to get the client user-agent with C#? I have tried the code flowering,but it does not work.


HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

string agent = request.UserAgent;


Any suggestions?


Thanks,


Leslu


No comments:

Post a Comment