private void BrowserControl_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e) { BrowserControl.InvokeScript("eval", "window.onerror=function(){return true}"); try { if (clear) { clear = false; BrowserControl.InvokeScript("eval", "localStorage.clear()"); } var o = BrowserControl.InvokeScript("eval", "localStorage.getItem('token')"); if (o != DBNull.Value) { aliyundrive.token.SetToken(o.ToString()); Close(); } Console.WriteLine("内容:{0}", o); } catch (Exception ex) { Console.WriteLine("错误:{0}", ex.Message); } }