Monday, March 28, 2011

Altering the uesr-agent string with the HTMLControl

I'm writing an app (VS2005, C++, targeting WM5) which is hosting the HTML Control. Can I modify the user-agent this control uses when making a request to a server?

From stackoverflow
  • http://msdn.microsoft.com/en-us/library/system.web.httpresponse.addheader.aspx

    Use AddHeader to modify the useragent.

    Since you are in a control, use this to get to your current HttpResponse object. this.Page.Response.AddHeader

    ctacke : He doesn't have an HttpResponse object. The question wants to know how to change the agent string being sent from an HTMLControl.
    Chris Ballance : Sure he does. Just reference the current page's HttpResponse object.
    brismith : I'm not using .Net CF. Is the HttpResponse object available by accessing a particular COM Interface?

0 comments:

Post a Comment