2011-03-09 46 views
0

,當我瀏覽到特定的網頁.NET中的Windows CE設備使用WebBrowser控件,它不走的點擊次數在谷歌網頁上page.eg搜索按鈕按鈕..WebBrowser控件爲Windows CE

其實這適用於1設備,而不適用於其他設備。

任何人都可以幫助解決這個問題嗎?

+1

哪些設備? SmartPhones或PocketPc觸摸屏?它在哪裏工作,哪裏不工作?哪個windows mobile版本? – 2011-03-09 12:17:53

+0

@Davide:都是PocketPc設備 – Anant 2011-03-10 05:07:28

+0

問題與http://stackoverflow.com/questions/2689030/google-search-is-not-working-in-web-browser-control相同 – Anant 2011-03-10 05:41:36

回答

0

這需要設置註冊表,並且需要設置的鍵是;

Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings並且需要在當前用戶註冊表中將「WarnOnZoneCrossing」設置爲「0」。

Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ Zones \ 3並且需要在本地計算機註冊表中將「1601」設置爲「0」和「1609」設置爲「0」。

的代碼看起來像

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); 
      }