首页 新闻 会员 周边

怎么删除windows phone 7.5 Webbrowser的Cookie

0
[待解决问题]

windows phone 7没有提供删除Cookie相关的API.

 

WebBrowser控件 cache住了上一次登录的网页信息了,

比如,我用人人网的SDK登录账户A,这时候不退出程序,logout想登录账户B,这时候发现再点击OAuth授权时,直接就显示登录成功,信息还是账户A的,没法登录账户B了

吴启平的主页 吴启平 | 初学一级 | 园豆:156
提问于:2012-11-15 23:46
< >
分享
所有回答(2)
0
I can not handle it. should have used a procedure to complete its work. I logout URL navigate directly to the parser from the website. 
Code:

private void btnlogout_Click(object sender, RoutedEventArgs e)
{
    string logout = Showalltopic.logoutString;
    webBrowser11.Source = new Uri("http://mydomain.com/login.php?do=logout&logouthash="+logout);
    webBrowser11.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(webBrowser11_LoadCompleted);
    btnlogin.Visibility = System.Windows.Visibility.Visible;
    btnlogout.Visibility = System.Windows.Visibility.Collapsed;
}

void webBrowser11_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
    string content = webBrowser11.SaveToString();
    if (content.Contains("All cookies cleared!"))
    {
        MessageBox.Show("Logout success");
        webBrowser11.Navigate(new Uri("http://mydomain.com/", UriKind.Absolute));
    }
    System.IO.IsolatedStorage.IsolatedStorageSettings _appSetting =
        System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
    _appSetting.Clear();
    _appSetting.Save();
}

after logout, WP7 information is stored in isolateStoraged clear that we must be able to logout successfully.
Hope everyone is no other way to clear the cookie in webbrowser.

试试,复制过来的

chenping2008 | 园豆:9836 (大侠五级) | 2012-11-16 09:29
0

我也在学

jerry-Tom | 园豆:4077 (老鸟四级) | 2012-11-16 10:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册