WebBrowser - UserAgent, Cookies - IE old version. How to change? Как сменить ЮзерАгента и куки?

  • Thread starter Thread starter ignadaevko
  • Start date Start date
I

ignadaevko

Guest
Hello, I have a problem with WebBrowser version, i can open the targer webSite, How to fix this problem? I have done the code, after searfing relevant rezults, but it's difficult to understand some time, so decide to ask the question here. Can i get support here about this problem?

tell me please

How to override the header - UserAgent - in the Code below:



TabPage nameOfTabPage = new TabPage("tabPage2");


Label label2sec = new Label();
label2sec.Text = singleWithIndexFromFile;
label2sec.Width = 400;


nameOfTabPage.Controls.Add(label2sec);

//- /- /- - /- /- // -/ - /-/- //-

WebBrowser frameWebBrowser = new WebBrowser();
Uri address = new Uri(@"Как определить и как изменить UserAgent в разных браузерах"); // i've checked the user agent here

frameWebBrowser.ScriptErrorsSuppressed = true;
// string UserAgents = @"Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 firefox/15.0.1";// +
// "Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + Environment.NewLine +
// "Accept-Language: en-gb";
frameWebBrowser.Navigate(address, null, null, @"User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 firefox/15.0.1");
// Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

frameWebBrowser.Height = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height;
frameWebBrowser.Width = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width;

nameOfTabPage.Controls.Add(frameWebBrowser);


tabControl1.TabPages.Add(nameOfTabPage);

tabControl1.SelectTab(nameOfTabPage);


how to write the correct working code, can help some body? Как исправить ошибку, из-за чего оно тут? Нужно переназначить ЮзерАгента, но этот код работаетне корректно.

Continue reading...
 
Back
Top