Dec 25, 2014 05:55 PM
(This post was last modified: Dec 25, 2014 06:52 PM by KingDeath360.)
Drag File [OUT] of form
We all know how to drag a file into the form.
But this lets us drag one out
So for example you are building a 'FTP Manager' you will want to drag the remote files to the desktop
Code
Private Sub Button1_DragLeave(sender As Object, e As EventArgs) Handles Button1.MouseDown
Dim filepath As String = "D:\Users\lol\Appdata\Temp\lol.txt"
Dim data As DataObject = New DataObject()
data.SetData(DataFormats.FileDrop, New String() {filepath})
Button1.DoDragDrop(data, DragDropEffects.Copy)
End SubWrite to hidden partition
If you have a hidden partition, you will want to write data to it without assigning a a drive-label
Code
Dim array() As Int32 = {1, 4, 6, 7, 11, 55, 777, 23, 266, 44, 82, 93}
Using writer As BinaryWriter = New BinaryWriter(System.IO.File.Open("\\?\Volume{343894234-3D32-34E3-DF34-343423432423443}\\lol.txt", FileMode.Create))
' Write each integer.
For Each value1 As Int32 In array
writer.Write(value1)
Next
End Using

