![]() |
|
[VB.NET] Some Snippets - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.NET] Some Snippets (/Thread-VB-NET-Some-Snippets) |
[VB.NET] Some Snippets - Codebreaker - 02-11-2011 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 SubRE: [VB.NET] Some Snippets - 1llusion - 02-12-2011 I just missed your snippets so much Thanks man!!! Ur awesome!!!!
RE: [VB.NET] Some Snippets - 1234hotmaster - 02-12-2011 awesome snippets :thumbs: RE: [VB.NET] Some Snippets - Codebreaker - 02-12-2011 (02-12-2011, 12:18 AM)1llusion Wrote: I just missed your snippets so muchThey misses u 2! lol No Problem man (02-12-2011, 11:40 AM)1234hotmaster Wrote: awesome snippets :thumbs:Thank u dude! |