9.2. 清除当前cookie:clearCurCookies


    /*
     * Note: currently support auto handle cookies
     * currently only support single caller -> multiple caller of these functions will cause cookies accumulated
     * you can clear previous cookies to avoid unexpected result by call clearCurCookies
     */
    public void clearCurCookies()
    {
        if (curCookies != null)
        {
            curCookies = null;
            curCookies = new CookieCollection();
        }
    }

    

例 9.2. clearCurCookies 的使用范例


    //http://www.crifan.com/example_of_how_to_use_ie9_f12_to_capture_the_real_music_mp3_address_of_some_songtaste_musc/
    // here must clear previous cookies
    // otherwise access html with previous cookies will get fault html:
    //信息提示:   对不起,该用户不存在! 3 秒钟以后系统将自动跳转!
    crl.clearCurCookies();
 
    string respHtml = "";
    respHtml = crl.getUrlRespHtml(songInfo.url, stHtmlCharset);

        

另外InsertSkydriveFiles中的一个例子:


        private void clearGolobalValues()
        {
            //gCurDomain = "";
            skydriveCookies = null;
            commLib.clearCurCookies();