[VB.NET] Some Snippets 02-11-2011, 10:59 PM
#1
Empty Recycle Bin
Code:
Public Class Form1
Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hWnd As Int32, ByVal pszRootPath As String, ByVal dwFlags As Int32) As Int32
Private Declare Function SHUpdateRecycleBinIcon Lib "shell32.dll" () As Int32
Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4
#Region "Empty Recycle Bin (SUB)"
Private Sub EmptyRecycleBin()
SHEmptyRecycleBin(Me.Handle.ToInt32, vbNullString, SHERB_NOCONFIRMATION + SHERB_NOSOUND)
SHUpdateRecycleBinIcon()
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
EmptyRecycleBin()
End Sub
End ClassDownloader
Code:
My.Computer.Network.DownloadFile(textbox1.text)Shutdown
Simple:
Code:
Shell("Shutdown -s")Advanced:
Code:
System.Diagnostics.Process.Start("shutdown", "-s -t 05 -c mess with me and get hacked like the rest")Disable Showing Hidden Files
Code:
'****Credits Goes To James******
Sub Hide()
Dim regloc as String = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
My.Computer.Registry.SetValue(regloc, "Hidden", "0", Microsoft.Win32.RegistryValueKind.DWord)
End Sub

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


Thanks man!!! Ur awesome!!!!