Hack Forums
[.NET] Write to hidden partition, Drag File [OUT] of form - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Write to hidden partition, Drag File [OUT] of form (/showthread.php?tid=4602439)



Write to hidden partition, Drag File [OUT] of form - KingDeath360 - Dec 25, 2014

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 Sub

Write 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



* - RandomUser123 - Dec 25, 2014

(Dec 25, 2014 05:55 PM)KingDeath360 Wrote:  "\\?\Volume{343894234-3D32-34E3-DF34-343423432423443}\\lol.txt"

May you better explain this part?

And, for each value1 in Array? Which array?


* - +Haze - Dec 25, 2014

(Dec 25, 2014 06:49 PM)RandomUser123 Wrote:  May you better explain this part?

And, for each value1 in Array? Which array?

Read the code again and you'll see. But then again this could of been prevented if OP used decent naming conventions.


* - RandomUser123 - Dec 27, 2014

(Dec 25, 2014 07:06 PM)+Haze Wrote:  Read the code again and you'll see. But then again this could of been prevented if OP used decent naming conventions.

Ye, sorry, i don't know why i didnt see it before -_-"