Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cookiePath() As String = Directory.GetFiles("C:\Documents and Settings\den\Cookies") /// path to your cookies folder must go here.
Dim x As Integer
For x = LBound(cookiePath) To UBound(cookiePath)
If cookiePath(x).Substring(cookiePath(x).Length - 4, 4) = ".txt" Then
File.Delete(cookiePath(x))
End If
Next
End Sub
System.Environment.SpecialFolder.Cookies
Dim files() as string = IO.Directory.GetFiles(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies))
Dim f As IO.FileInfo
Dim dir As New IO.DirectoryInfo("C:\Documents and Settings\user1\Cookies\")
For Each f In dir.GetFiles
If f.Extension = ".txt" Then
IO.File.Delete(f.FullName)
End If
Next
Request.Cookies.Clear() Clear all cookies
MrPaul said:If a website were able to remotely delete all of a clients cookies this sounds like a bit of a security flaw, and even if it is possible I would advise against it. You can delete all of a clients cookies for the current site by using the Request.Cookies collection. You can also use this collection to add, modify, inspect and delete individual cookies.
Code:Request.Cookies.Clear() Clear all cookies
Good luck
For i As Integer = Request.Cookies.Count - 1 To 0 Step -1
Dim c As New HttpCookie(Request.Cookies(i).Name)
c.Expires = DateTime.Now.AddDays(-1D)
Request.Cookies.Add(c)
Next
for (int i = Request.Cookies.Count - 1; i >= 0; i--) {
HttpCookie c = new HttpCookie(Request.Cookies[i].Name)
c.Expires = DateTime.Now.AddDays(-1d)
Request.Cookies.Add(c)
}
function resetStatus()
{
var abssize = document.body.offsetWidth-30;
if((event.clientY < 0 && event.clientX >= abssize) || (event.clientY < 0 &&
event.clientX >= 0))
{
alert("The page will now close.");
window.open("../forceLogout.asp", "_blank");
}
}