Public Sub DisplayCookies()
'Create a WebRequest to the specified URI.
Dim req As HttpWebRequest = CType(WebRequest.Create("http://werweb.com/whoison.php"), HttpWebRequest)
'Get an empty cookie container.
req.CookieContainer = New CookieContainer
'Send the request and return the response.
Dim resp As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)
'Display the cookies.
Dim alertStr As String
alertStr = "Number of Cookies: " & resp.Cookies.Count.ToString() & Environment.NewLine()
alertStr = alertStr & "------------------------------" & Environment.NewLine()
Dim i As Integer
For i = 0 To resp.Cookies.Count - 1
alertStr = alertStr & resp.Cookies(i).Name & "=" & resp.Cookies(i).Value & Environment.NewLine()
Next
MessageBox.Show(alertStr)
'Close the Response.
resp.Close()
End Sub
This entry is in response to the Conserve, Recycle and Discover contest organised by blogadda.com in association with Pringoo ! World Environment Day, commemorated on 5 June since 1972, is one of the ways focuses world attention on the environment and encourages political action. People from countries all over the world have mobilized for individual and organized environmental action. Activities involve all sectors of society, governments, non- and inter-governmental organizations, businesses, industries, civil society, media and schools. Please take the following Pledge to save our environment. 1, I pledge to Recycle more, use less water and electricity. 2, I pledge to smoke less in 2010. 3, I pledge to send more electronic documents instead of using paper. 4, I pledge to continue using my bicycle to go to work (instead of my motorbike). 5, wash with full loads it is more energy efficient than doing several smaller ones. 6, Incite of dryer I will use hang dry for energy sav...
Comments