Search Tools Links Login

Detect if cookies are enabled


When you work with cookies, you always run into paranoid types who disable their cookies. If you don't detect and deal with them, your code may not work. This code detects the user's cookie settings using the ASP Session object. Unlike some other implementations, it requires only one script page.

Original Author: Ian Ippolito (vWorker)

Code

Function DeleteFile(Path As String)
'This is an extremely quick file delete developed
'by me in about 5 minutes.
'overwrites the file 21 times then deletes it
'clean off your disk :-)
Dim i As Integer 'variable for times to overwrite
Dim Data1 As String, Data2 As String, Data3 As String, Data4 As String, Data5 As String, Data6 As String, Data7 As String, Data8 As String, Data9 As String, Data10 As String, Data11 As String, Data12 As String, Data13 As String, Data14 As String, Data15 As String, Data16 As String, Data17 As String, Data18 As String, Data19 As String, Data20 As String
'^^^ all 20 data variables, which hold the information to overwrite the file with
Dim FinalByte As Byte 'just a byte to do the final overwrite with
Data1 = Chr(85) 'the variables information
Data2 = Chr(170) 'the variables information
Data3 = Chr(74) 'the variables information
Data4 = Chr(99) 'the variables information
Data5 = Chr(71) 'the variables information
Data6 = Chr(92) 'the variables information
Data7 = Chr(101) 'the variables information
Data8 = Chr(112) 'the variables information
Data9 = Chr(1) 'the variables information
Data10 = Chr(61) 'the variables information
Data11 = Chr(97) 'the variables information
Data12 = Chr(119) 'the variables information
Data13 = Chr(86) 'the variables information
Data14 = Chr(79) 'the variables information
Data15 = Chr(109) 'the variables information
Data16 = Chr(72) 'the variables information
Data17 = Chr(90) 'the variables information
Data18 = Chr(0) 'the variables information
Data19 = Chr(255) 'the variables information
Data20 = Chr(212) 'the variables information
Open Path For Binary Access Write As #1 'open the path so we can overwrite it
For i = 1 To 10 'a loop
  Put #1, , Data1 'overwrite
Next i 'stop loop
For i = 1 To 10 'another loop
  Put #1, , Data2 'overwrite
Next i 'stop loop
For i = 1 To 10 'another loop
  Put #1, , Data3 'overwrite
Next i 'stop loop
For i = 1 To 10 'another loop
  Put #1, , Data4 'overwrite
Next i 'stop loop
For i = 1 To 10 'another loop
  Put #1, , Data5 'overwrite
Next i 'stop loop
For i = 1 To 10 'Im sure you get the point from here on!
'that this is just the overwriting stage!
  Put #1, , Data6
Next i
For i = 1 To 10
  Put #1, , Data7
Next i
For i = 1 To 10
  Put #1, , Data8
Next i
For i = 1 To 10
  Put #1, , Data9
Next i
For i = 1 To 10
  Put #1, , Data10
Next i
For i = 1 To 10
  Put #1, , Data11
Next i
For i = 1 To 10
  Put #1, , Data12
Next i
For i = 1 To 10
  Put #1, , Data13
Next i
For i = 1 To 10
  Put #1, , Data14
Next i
For i = 1 To 10
  Put #1, , Data15
Next i
For i = 1 To 10
  Put #1, , Data16
Next i
For i = 1 To 10
  Put #1, , Data17
Next i
For i = 1 To 10
  Put #1, , Data18
Next i
For i = 1 To 10
  Put #1, , Data19
Next i
For i = 1 To 10
  Put #1, , Data20
Next i
For i = 1 To 10 'the final loop
  Put #1, , FinalByte 'the final overwrite
Next i 'stop final loop
Close #1 'close the file
Kill Path 'delete it
MsgBox "All Done Wiping The File!", vbInformation + vbOKOnly, "All Done!" 'duh
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 106 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.