Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on using cookies with CreateMHTMLBody
Message
From
19/10/2007 15:43:41
 
 
To
19/10/2007 13:05:51
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01262216
Message ID:
01262271
Views:
11
Using the cookie directly at the CDO.Message level works:
        ' Get the cookie
        loWebResponse = loWebRequest.GetResponse()
        loCookieCollection = loWebResponse.Cookies

        loWebRequest.CookieContainer.Add(loCookieCollection)

        For lnCounter = 0 To loCookieCollection.Count - 1
            lcCookie = loCookieCollection.Item(lnCounter).Name
            If lcCookie = "LevelExtremeSession" Then
                lcCookie = loCookieCollection.Item(lnCounter).Value

                ' Define the cookie
                loMessage.Configuration.Fields.Item(CDO.CdoConfiguration.cdoHTTPCookies).Value = _
                 "LevelExtremeSession=" + lcCookie

            End If
        Next

        ' Go get the page
        loMessage.CreateMHTMLBody("http://www.myurl.com/MyPage.aspx", CDO.CdoMHTMLFlags.cdoSuppressNone, "", "")

        loStream = loMessage.GetStream()

        ' Save to file
        loStream.SaveToFile("D:\Test.mhtml", SaveOptionsEnum.adSaveCreateOverWrite)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform