|
Rank: Member Groups: Member
Joined: 9/11/2014 Posts: 17
|
Hello eo_support! I trying change proxy config in runtime, but not anything changing. This's my code:
Code: C#
private void LoadNexUrl()
{
m_SelectedLinkIndex++;
if (m_SelectedProxyIndex == -1)
{
lbProxies.SelectedIndex = m_SelectedProxyIndex = 0;
}
if (m_SelectedLinkIndex >= lbLinks.Items.Count)
{
m_SelectedLinkIndex = 0;
m_SelectedProxyIndex++;
if (m_SelectedProxyIndex >= lbProxies.Items.Count)
m_SelectedProxyIndex = 0;
lbProxies.SelectedIndex = m_SelectedProxyIndex;
}
SetupProxy(lbProxies.SelectedItem.ToString());
lbLinks.SelectedIndex = m_SelectedLinkIndex;
if (tabPage1.Controls.Count > 0)
{
((WebControl)tabPage1.Controls[0]).Dispose();
tabPage1.Controls.Clear();
}
WebControl webControl = CreateWebControl();
tabPage1.Controls.Add(webControl);
webControl.WebView.Url = lbLinks.SelectedItem.ToString();
}
private WebControl CreateWebControl()
{
WebControl webcontrol = new WebControl();
webcontrol.Dock = DockStyle.Fill;
WebView w = new WebView();
webcontrol.WebView = w;
w.IsLoadingChanged += new EventHandler(WebView_IsLoadingChanged);
w.BeforeDownload += new BeforeDownloadHandler(WebView_BeforeDownload);
w.TitleChanged += new EventHandler(WebView_TitleChanged);
return webcontrol;
}
private void SetupProxy(string proxy)
{
string[] prx = proxy.Split(':');
if (EO.WebBrowser.Runtime.Proxy == null || EO.WebBrowser.Runtime.Proxy.HostName != prx[0])
{
EO.WebBrowser.Runtime.Proxy = new ProxyInfo(ProxyType.HTTP, prx[0].Trim(), int.Parse(prx[1].Trim()));
}
}
private void btnStart_Click(object sender, EventArgs e)
{
try
{
LoadNexUrl();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Please help me!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
You won't be able to do that in the current version. Currently ProxyInfo can only be set once and it must be set before any WebViews are created. If you must change it, you will need to create all WebViews in a different app domain and then unload the whole app domain, or you can simply write the new setting into a configuration file and then restart your app. Sorry about it!
|
|
Rank: Member Groups: Member
Joined: 9/11/2014 Posts: 17
|
Thank eo_support! Please contact me when you resolved this problem! :)
|
|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
Is there any news on when we will be able to change the ProxyInfo during runtime without having to recreate all the WebViews?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
benpm wrote:Is there any news on when we will be able to change the ProxyInfo during runtime without having to recreate all the WebViews? Unfortunately no. We have not implemented any changes on this regard yet. Sorry about it!
|
|
Rank: Advanced Member Groups: Member
Joined: 1/12/2015 Posts: 81
|
It looks like you've made changes to the ProxyInfo in the version since 2015 so that you can edit it for each engine. Is there any way to change proxies from one page load to the next with the same engine?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
No. You can not change proxy from one page to the next within the same engine.
Thanks
|
|