VB 2008 - Useful Code - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: VB 2008 - Useful Code (/showthread.php?tid=3199) |
VB 2008 - Useful Code - Apache - 11-28-2009 Hello everyone. I previously posted this tutorial on HF , but I recently left and joined SF. I thought that this may be useful to some beginners. Make the computer talk Code: Dim sapi Create a messagebox Code: MsgBox("TextHere") Create A Message Box With A Yes + No Button Code: Dim Responce As Integer To change buttons,replace "vbyesno" with one of the following: Code: vbYesNoCancel Start a process Code: Process.Start("notepad") Kill a process Code: Dim RunningProcess As System.Diagnostics.Process = Process.GetProcessesByName("taskmgr.exe")(0) Rename a file Code: My.Computer.FileSystem.RenameFile ("C:\Program Files\Mozilla Firefox\firefox.exe", "Anything.exe") Delete a file Code: Dim FileToDelete As String Copy a file Code: Dim FileToCopy As String Delete a registry key Code: My.Computer.Registry.LocalMachine.DeleteSubKey("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SafeBoot") Create a registry key Code: Dim regKey As RegistryKey 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" Create an if statement (File Deletion) Code: Dim FileToDeleteWithAIfStatement As String For loop Code: For MessageBox = 1 To 60 Hide your application Code: Me.Hide () Send an email with an attachment via SMTP Source Code: Dim message As System.Net.Mail.MailMessage Visual Basic 2008 tutorials: Link 1 Link2 The history of Visual Basic: Link1 Link2 Do not quote post do to size.Thank you. RE: VB 2008 - Useful Code - Smed - 11-28-2009 these are nice dude sure they will help people out. RE: VB 2008 - Useful Code - flAmingw0rm - 11-28-2009 Thanks a lot, i've read this on HF before. Very useful, well done. RE: VB 2008 - Useful Code - Red X - 12-04-2009 Thank you. I hope I will be able to use one of these unique functions in my upcoming application. RE: VB 2008 - Useful Code - thanasis2028 - 12-10-2009 Oh! I knew about all of them except from killing a process. Thanks. RE: VB 2008 - Useful Code - Red X - 12-10-2009 (12-10-2009, 05:39 AM)thanasis2028 Wrote: Oh! I knew about all of them except from killing a process. Thanks. You mean "for" instead of "from" right? xD RE: VB 2008 - Useful Code - HmanDude - 12-11-2009 Thanks for the codes mate. The process ones really helped me RE: VB 2008 - Useful Code - RaZoR03 - 04-18-2010 O_O.. Very useful..Thanks dude.. RE: VB 2008 - Useful Code - trubufo - 04-28-2010 Very useful Maybe i use this e-mail one later ! Thank you RE: VB 2008 - Useful Code - TurB0 - 04-29-2010 Nice codes for newbies! Thank you! |