質問

I have a problem with the System.Net.WebClient DownloadString method. I use this method to invoke an aspx page that perform some operations using a library. Now, this library is used trough a WebService too, that is sensible to Internet Explorer language setting. This mean that if I login via this WebService trough Internet Explorer the library stores (in a way that I can't control) the last used language.

This is causing me troubles because when I use the DownloadString method to invoke my aspx page, even if I set the Headers["Accept-Language"] = "en-US" to the WebClient object, the DLL uses the last Internet Explorer language.

The question is: is there any parameter that is sent with Internet Explorer with its language setting? If yes, how can I set this in the WebClient powershell instance?

役に立ちましたか?

解決

As suggested by Raf the answer is in the combination of header+session, I just had to log out the Web service to allow a redefinition of the language via PowerShell using Accept-Language header parameter.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top