Categorized | Security

Drag and Drop to get filepath

These pieces of code allow you to drag and drop a file into a picturebox and it will display the full path in a TextBox.

Private Sub exelreader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
‘exelreader is the Form name and pb is the name of the PictureBox
pb.AllowDrop = True
End Sub

Private Sub pb_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pb.DragEnter
If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
e.Effect = DragDropEffects.Copy
End If
End Sub

Private Sub pb_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pb.DragDrop
Dim filePaths As String() = {“”}
Try
filePaths = CType(e.Data.GetData(DataFormats.FileDrop), String())
Catch ex As Exception
TextBox1.Text = ex.Message
TextBox1.Text &= “Error Doing Drag/Drop”
End Try
For Each filename In filePaths
TextBox1.Text = filename
Next
End Sub

View full post on Metallica’s blog

Related Posts
  • Spam Volume Drop on Christmas Day
    The monthly State of Spam & Phishing report has been tracking the decline of overall spam in recent months. The chart below shows the global spam volume dropping significantly since August. An e...
  • Sudden spam drop leaves experts baffled
    Spam volumes appear to have dropped to averages last seen in 2008 after an expected surge in bogus email over the Christmas period failed to materialise. Full story: Network World on Security...
  • Spam Volumes Drop After Spamit Shakeup
    The last few weeks has seen quite a shakeup in the spamming world.  Our Spam Volume Index, which records relative movements in spam volume sent to a bundle of domains we monitor, has recorded a subst...
  • The dead drop resurrected?
    ... a drop used for the clandestine exchange of intelligence information... This is one definition of a 'dead drop', and one's mind automatically switches to images of John le Car...
  • Significant drop in spam levels since end of September 2010
    MX Lab, http://www.mxlab.eu, noticed a significant drop in the spam level since 22 September 2010. The global numbers show us a decline of approx. 40% even during business days when spam levels are hi...
  • Drop ‘responsible’ from bug disclosures, Microsoft urges
    Microsoft today pitched its own proposal for how software makers react to bugs reported by researchers, calling for a name change to describe the process it prefers. View full post on Computerworld...
  • Countries ask Google to drop “launch now, fix later” policy
    Government officials from 10 countries sent Google an open letter (PDF) this week asking the company to adhere to a list of privacy principles in the wake of the company's botched ...
  • Massive Drop in Number of Active Zeus C&C Servers
    I always check the ZeuS Tracker statistics to get some information about the trend of the active ZeuS Command&Control servers. This morning I was really surprised what I saw on the ZeuS Tracker s...
  • AS50215 Troyak-as Taken Offline, Zeus C&Cs Drop from 249 to 181
    2nd update for Friday, March, 12, 2010 - Troyak-AS is down again - "This AS is not currently used to announce prefixes in the global routing table, nor is it used as a visible transit AS." UPDATED: ...

Comments are closed.

Security Status

Beware Facebook "Timeline" scams http://t.co/W5EW0cVv
1 month ago
Nigerian government (unknowingly) hosts phishing website http://t.co/uQd42ENw
1 month ago
PCMag Awards McAfee All Access its Editors’ Choice: SANTA CLARA, Calif.--(BUSINESS WIRE)--McAfee today announced... http://t.co/FakV7Vd8
1 month ago
RT @mikko: I hadn't noticed Google Maps has added 3D models of buildings. Here's a (very accurate) view of F-Secure HQ in Helsinki http://t.co/IKfAZlak
1 month ago
North Koreans aren't known for their online presence. But others may be lured into clicking Kim Jong-Il 'videos' too http://t.co/yQOon6YT
1 month ago
How to Protect Your Professional Reputation on Facebook Timeline http://t.co/I4bcR2VN
1 month ago
This is pretty impressive from @Softpedia: Facebook scans 2 trillion link clicks and blocks 220 million posts each day http://t.co/vKsn9gNl
1 month ago
Need for integrated approach to security in industrial control systems - http://t.co/tPBCNOow with @PikeResearch
1 month ago
Some free-based music we play at work http://t.co/xu5agZfc
1 month ago
Japan’s cyber defense weapon: a virus. It includes quotes by @Luis_Corrons via @InfosecurityMag
1 month ago