Saturday, 7 January 2012
[VB.NET] Usefull Source Codes
Do you like this story?
Open a Website:
Process.Start("www.bumpbox.net") Process.Start("www.myforum.net")
Open something
Shell("Notepad") Shell("Calculator")
Delete a file
Dim FileToDelete As String FileToDelete = "C:\File.exe" If System.IO.File.Exists(FileToDelete) = True Then System.IO.File.Delete(FileToDelete)
Kill a process
Dim RunningProcess As System.Diagnostics.Process = Process.GetProcessesByName("taskmgr.exe")(0) RunningProcess.Kill()
Rename a file
My.Computer.FileSystem.RenameFile ("C:\Program Files\Mozilla Firefox\firefox.exe", "Anything.exe")
Delete a registry key
My.Computer.Registry.LocalMachine.DeleteSubKey("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot")
Create a registry key
Dim regKey As RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True) regKey.CreateSubKey("MyApp") regKey.Close()
Text To Speech:
Dim sapi sapi = CreateObject("sapi.spvoice") sapi.Speak(Textbox1.text)
Fade in
For FadeIn = 0.0 To 1.1 Step 0.1 Me.Opacity = FadeIn Me.Refresh() Threading.Thread.Sleep(100) Next
Fade out:
For FadeOut = 90 To 10 Step -10 Me.Opacity = FadeOut / 100 Me.Refresh() Threading.Thread.Sleep(50) Next
Minimize To Tray
Just Add a Notifyicon
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize If Me.WindowState = FormWindowState.Minimized Then Me.Hide() End If End Sub Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick If Me.WindowState = FormWindowState.Minimized Then Me.Show() Me.WindowState = FormWindowState.Normal End If End Sub
Add Music To Your Tool:
First Add your music to Resources
Note: The File Type Of The Music must be .wav
Double Click Button1 (start):
My.Computer.Audio.Play(My.Resources.song namenowav, AudioPlayMode.BackgroundLoop)
Double Click Button2 (stop)
My.Computer.Audio.Stop()
Count Files In Folders:
Dim NOF As Integer Dim FilePath As String = TextBox1.Text NOF = System.IO.Directory.GetFiles(FilePath).Length TextBox2.Text =NOF.ToString
Google Searcher
Add:
Process
Button
Double Click The Button and Write:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "" Then msgbox("WTF :| ? are u searching for nothing o.0 ?) Else Process1.StartInfo.FileName = (" & TextBox1.Text & "&btnG=Search&meta=") Process1.Start() End If End Sub
Case Example
Add:
1 Button
1 Textbox
Double Click the Button and write:
TextBox1.Text = Int(Rnd() * 4) Select Case TextBox1.Text Case 0 TextBox1.Text = "anything" Case 1 TextBox1.Text = "passgenerator" Case 2 TextBox1.Text = "CD key" Case 3 TextBox1.Text = "strings" End Select
Login Example:
Add:
1 button
Click The Button and write:
If TextBox1.Text = "CodeBreaker" _ And TextBox2.Text = "TheEndGamer" Then MsgBox("Welcome to Bumpbox.net") Else MsgBox("Euuhh? do i know u :S ?") End If
Xfire Add Friender and status changer (Just an example)
Add:
2 buttons
1 webbrowser
2 textboxes
Button1.text = Change Status
Button2.text = Add Friend
Double Click Button1 and write:
WebBrowser1.Navigate("xfire:status?text= " & TextBox1.Text)
Double Click Button2 and Write:
WebBrowser1.Navigate("xfire:add_friend?u ser=" & TextBox2.Text)
Screen Capture:
You Need a large picturebox
button1 = "Shoot"
Button2 = "Save"
Textbox1
Textbox2
Double Click Button1 and write:
Dim BumpBox As Rectangle Dim screenshot As System.Drawing.Bitmap Dim graph As Graphics BumpBox = Screen.PrimaryScreen.BumpBox screenshot = New System.Drawing.Bitmap(BumpBox.Width, BumpBox.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) graph = Graphics.FromImage(screenshot) graph.CopyFromScreen(BumpBox.X, BumpBox.Y, 0, 0, BumpBox.Size, CopyPixelOperation.SourceCopy) PictureBox1.Image = screenshot
Double Click Button2 and write:
Dim savefile As New System.IO.StreamWriter("C:\Users\" + TextBox1.Text + "\documents\" + TextBox2.Text + ".jpg")
savefile.Write(PictureBox1.Image)
savefile.Close()
MsgBox("Pictue Saved ", MsgBoxStyle.Exclamation, "Done!")
Picture Viewer:
Add:
1 Button
1 PictureBox
Double Click Button1 and write:
Try OpenFileDialog1.Title = "Open Picture" OpenFileDialog1.FileName = ".jpg" OpenFileDialog1.Filter = "All Files |*.*" OpenFileDialog1.ShowDialog() PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDi alog1.FileName) Catch ex As Exception End Try
Chat Spammer
Add:
2 Buttons
1 Timer
Double Click Button1(Start) and write:
timer1.start
Double Click Button2(Stop) and write:
timer1.stop
Then... Double Click Timer1 and Write:
SendKeys.Send(TextBox1.Text) SendKeys.Send("{ENTER}")
HotKeyChat Spammer!
Drag a textbox out there follow up with 2 timer's. Change Timer2 to Enabled = True
Add 2 labels and change label1.text to Start=F1 and label2.text stop=F2 (or whatever key you choose to use).
Double click timer1 and write:
SendKeys.Send(TextBox1.Text) SendKeys.Send("{ENTER}")
Double click Form1 and write:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Double click timer2 :
Dim starthotkey As Boolean starthotkey = GetAsyncKeyState(Keys.F1) If starthotkey = True Then Timer1.Start() End If Dim stophotkey As Boolean stophotkey = GetAsyncKeyState(Keys.F2) If stophotkey = True Then Timer1.Stop() End If
you can change GetAsyncKeyState(Keys.) Ex. Keys.End)
CD-Rom Prank
Do Dim oWMP = CreateObject("WMPlayer.OCX.7") Dim colCDROMs = oWMP.cdromCollection If colCDROMs.Count = 1 Then For i = 0 To colCDROMs.Count - 1 colCDROMs.Item(i).Eject() Next ' cdrom End If Loop
Disable Firewall:
Dim Bumpbox As Process = New Process Dim top As String = "netsh.exe" Bumpbox.StartInfo.Arguments = ("firewall set opmode disable") Bumpbox.StartInfo.FileName = top Bumpbox.StartInfo.UseShellExecute = False Bumpbox.StartInfo.RedirectStandardOutput = True Bumpbox.StartInfo.CreateNoWindow = True Bumpbox.Start() Bumpbox.WaitForExit()
Shutdown Manager:
Shutdown:
Shell("Shutdown -s")
Restart:
Shell("Shutdown -r")
LogOff:
Shell("Shutdown -l")
This post was written by: Franklin Manuel
Franklin Manuel is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “[VB.NET] Usefull Source Codes”
Post a Comment