WebBrowser control in .net for windows ce

左心房为你撑大大i 提交于 2019-12-13 08:11:25

问题


when I navigate to particular page using WebBrowser control in .net for windows ce device, it is not taking clicks for buttons on page.e.g Search button on Google page..

Actually this works for 1 device and not for other..

Can anybody help out solving this?


回答1:


This needs to set registry, and keys that need be set are;

Software\Microsoft\Windows\CurrentVersion\Internet Settings and the value that need to set is "WarnOnZoneCrossing" to '0' in current user registry.

Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3 and the value that need to set is "1601"to '0' and "1609" to '0' in local machine registry.

The code will look like

using (RegistryKey key = Registry.CurrentUser.OpenSubKey (@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings", true))
            {
                if (key == null)
                {                    Registry.CurrentUser.CreateSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings");
                    using (RegistryKey newKey = Registry.CurrentUser.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings", true))
                    {
                        newKey.SetValue("WarnOnZoneCrossing", 0);
                    }
                }
                else
                    key.SetValue("WarnOnZoneCrossing", 0);
            }
            //enable submission of non-encrypted form data
            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", true))
            {
                if (key == null)
                {
                    Registry.LocalMachine.CreateSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3");
                    using (RegistryKey newKey = Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", true))
                    {
                        newKey.SetValue("1601", 0);
                    }
                }
                else
                    key.SetValue("1601", 0);
            }
            //enable the display of mixed content
            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", true))
            {
                if (key == null)
                {
                    Registry.LocalMachine.CreateSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3");
                    using (RegistryKey newKey = Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", true))
                    {
                        newKey.SetValue("1609", 0);
                    }
                }
                else
                    key.SetValue("1609", 0);
            }


来源:https://stackoverflow.com/questions/5245452/webbrowser-control-in-net-for-windows-ce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!