Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Tutorial]Snippets Part 3[Snip]

Post[Tutorial]Snippets Part 3[Snip]

Posts 1–4 of 4 · Page 1 of 1
NextGen1
NextGen1
[Tutorial]Snippets Part 3[Snip]
Snippets Part 3
I will Be adding more as I write them

Empty Recycling Bin

Declarations And Variables

[php]
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
[/php]

Empty Recycling Bin Sub
[php]
Private Sub takeoutthetrash()
SHEmptyRecycleBin(Me.Handle.ToInt32, vbNullString, SHERB_NOCONFIRMATION + SHERB_NOSOUND)
SHUpdateRecycleBinIcon()
End Sub
[/php]

Code to call the empty recycling bin sub

[php]
takeoutthetrash()
[/php]


Add a Windows User

Add 3 TextBox's

Add 1 Button

TextBox1 will be for the new Username
Textbox2 will be the password field
Textbox3 will be the verify password field

Button_Click Event for button

[php]
Dim username As String = TextBox1.Text
Dim password As String = TextBox2.Text
'Match the passwords, if they match, then add user
If TextBox2.Text = TextBox3.Text Then
Shell("net user " & username & " " & password & " /add")

MessageBox.Show("Windows User Created)

Else
MessageBox.Show("Passwords are different")
End If
[/php]

Get Hardware Serial

Add the System Management Reference.

Project -- Add Reference --.Net -- System.Managment

Create a New Class and add this code

[php]
Public Class HardDrive
Private dsk_model As String
Private dsk_type As String
Private dsk_serialNo As String

Public Property Model() As String

Get
Return dsk_model
End Get
Set(ByVal value As String)
dsk_model = value
End Set
End Property

Public Property Type() As String

Get
Return dsk_type
End Get
Set(ByVal value As String)
dsk_type = value
End Set
End Property

Public Property serialNo() As String
Get
Return dsk_serialNo
End Get
Set(ByVal value As String)
dsk_serialNo = value
End Set
End Property

End Class
[/php]

Now Add a textbox to your form, set it to multiline=true

View Code

In the namespace

[php]
Imports System
Imports System.Collections
Imports System.Management
[/php]

Variables and Declarations

'Dim appname as system.STATthreadattribute()
Dim WindowsApplication1 As System.STAThreadAttribute()

In Form1 Load add

[php]
Dim SerialHD As New ArrayList()
Dim Obsearch As New ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
Dim HDinfo As New ManagementObject()

For Each HDinfo In Obsearch.Get

Dim hd As New Class1.HardDrive()

hd.Model = HDinfo("Model").ToString()
hd.Type = HDinfo("InterfaceType").ToString()
SerialHD.Add(hd)
Next

Dim searcher1 As New ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")


Dim i As Integer = 0
For Each HDinfo In searcher1.Get()



Dim hd As Class1.HardDrive
hd = SerialHD(i)

If HDinfo("SerialNumber") = "" Then
hd.serialNo = "None"
Else
hd.serialNo = HDinfo("SerialNumber").ToString()
i += 1
End If
Next

Dim hd1 As Class1.HardDrive
Dim ii As Integer = 0

For Each hd1 In SerialHD
ii += 1
TextBox1.Text = TextBox1.Text + "Serial No: " + hd1.serialNo + Chr(13) + Chr(10) + Chr(13) + Chr(10)
Next
[/php]


More coming soon, Check Back
#1 · edited 16y ago · 16y ago
Zoom
Zoom
Great tut/snip!
Alot of new thing I can learn, thanks next
#2 · 16y ago
PP
ppl2pass
error for ManagementObjectSearcher and ManagementObject.
#3 · 16y ago
NextGen1
NextGen1
Sorry, You have to add the reference.

Project -- Add Reference --.Net -- System.Managment
#4 · 16y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • [Tutorial/Snippet][VB6] Reading and writing INI FilesBy That0n3Guy in Visual Basic Programming
    6Last post 16y ago
  • Italian Tutorial Part #1By Casey95 in General
    6Last post 16y ago
  • [XNA] Developing Your First 2D Game Tutorial: Part 1By richdude212 in Programming Tutorials
    0Last post 15y ago
  • [C#] Tutorial: Understanding The Basics Part 1By richdude212 in Programming Tutorials
    2Last post 15y ago
  • Tutorials Part 2By HolyFate in Gunz General
    28Last post 20y ago

Tags for this Thread

#bin#empty#hwid#recycling#snippets#tutorial#vb.net#visual basic