4/28/11

[VB.NET][SNP] Disable Taskbar

 Dim intReturn As Integer = FindWindow("Shell_traywnd", "")  
     SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)  


And to enable it:
change SWP_HIDEWINDOW to SWP_SHOWWINDOW

[VB.NET][SNP] Disable Folder Options

 Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoFolderOptions /t REG_DWORD /d 1 /f", vbNormalFocus)  


Change the 1 to 0 to enable it again.

4/26/11

[VB.NET][TUT] STRINGS - Big TUT Collection Part 4

-------How to VB.NET String.Copy()

VB.NET String Copy method is create a new String object with the same content


System.String.Copy(ByVal str As String) As String

Parameters:

String str : The argument String for Copy method

Returns:

String : Returns a new String as the same content of argument String

Exceptions:

System.ArgumentNullException : If the argument is null.

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str1 As String  
     Dim str2 As String  
     str1 = "VB.NET Copy() test"  
     str2 = String.Copy(str1)  
     MsgBox(str2)  
   End Sub  
 End Class  

-------How to VB.NET String.Contains()

The Contains method in the VB.NET String Class check the specified parameter String exist in the String

System.String.Contains(String str) As Boolean

Parameters:

String str - input String for search

Returns:

Boolean - Yes/No

If the str Contains in the String then it returns true

If the str does not Contains in the String it returns False

For ex: "This is a Test".Contains("is") return True

"This is a Test".Contains("yes") return False

Exceptions:

System.ArgumentNullException : If the argument is null

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str As String  
     str = "VB.NET TOP 10 BOOKS"  
     If str.Contains("TOP") = True Then  
       MsgBox("The string Contains() 'TOP' ")  
     Else  
       MsgBox("The String does not Contains() 'TOP'")  
     End If  
   End Sub  
 End Class  

[VB.NET][TUT] STRINGS - Big TUT Collection Part 3

-------How to VB.NET String.Equals()

VB.NET String Equals function is to check the specified two String Object values are same or not

System.String.Equals(String str1, String str2) As Boolean

Parameters:

String str1 : The String argument

String str2 : The String argument

Returns:

Boolean : Yes/No

It return the values of the two String Objects are same

For ex :

Str1 = "Equals()"

Str2 = "Equals()"

String.Equals(Str1,Str2) returns True

String.Equals(Str1.ToLower,Str2) returns False

Because the String Objects values are different

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str1 As String = "Equals"  
     Dim str2 As String = "Equals"  
     If String.Equals(str1, str2) Then  
       MsgBox("Strings are Equal() ")  
     Else  
       MsgBox("Strings are not Equal() ")  
     End If  
   End Sub  
 End Class  


-------How to VB.NET String.CopyTo()

VB.NET String CopyTo method Copies a specified number of characters from a specified position in this instance to a specified position in an array of characters.

System.String.CopyTo(ByVal sourceIndex As Integer, ByVal destination() As Char, ByVal destinationIndex As Integer, ByVal count As Integer)

Parameters:

Integer sourceIndex : The starting position of the source String

Char destination() : The character Array

Integer destinationIndex : Array element in the destination

Integer count : The number of characters to destination

Exceptions:

System.ArgumentNullException : If the destination is null

System.ArgumentOutOfRangeException :

Source Index, DestinationIndes or Count is a -ve value

Count is greater than the length of the substring from startIndex to the end of this instance

count is greater than the length of the subarray from destinationIndex to the end of destination

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str1 As String = "CopyTo() sample"  
     Dim chrs(5) As Char  
     str1.CopyTo(0, chrs, 0, 6)  
     MsgBox(chrs(0) + chrs(1) + chrs(2) + chrs(3) + chrs(4) + chrs(5))  
   End Sub  
 End Class  

[VB.NET][TUT] STRINGS - Big TUT Collection Part 2

-------How to VB.NET String.IndexOf()

The IndexOf method in String Class returns the index of the first occurrence of the specified substring.

System.String.IndexOf(String str) As Integer

Parameters:

str - The parameter string to check its occurrences

Returns:

Integer - If the parameter String occurred as a substring in the specified String

it returns position of the first character of the substring .

If it does not occur as a substring, -1 is returned.

Exceptions:

System.ArgumentNullException: If the Argument is null.

For ex:

"This is a test".IndexOf("Test") returns 10


"This is a test".IndexOf("vb") returns -1

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str As String  
     str = "VB.NET TOP 10 BOOKS"  
     MsgBox(str.IndexOf("BOOKS"))  
   End Sub  
 End Class  

-------How to VB.NET String.Format()

VB.NET String Format method replace the argument Object into a text equivalent System.Striing.

System.Format(ByVal format As String, ByVal arg0 As Object) As String

Parameters:

String format : The format String

The format String Syntax is like {indexNumber:formatCharacter}

Object arg0 : The object to be formatted.

Returns:

String : The formatted String

Exceptions:

System.ArgumentNullException : The format String is null.

System.FormatException : The format item in format is invalid.

The number indicating an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

For ex :

Currency :

String.Format("{0:c}", 10) will return $10.00

The currency symbol ($) displayed depends on the global locale settings.

Date :

String.Format("Today's date is {0:D}", DateTime.Now)

You will get Today's date like : 01 January 2005

Time :

String.Format("The current time is {0:T}", DateTime.Now)

You will get Current Time Like : 10:10:12

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim dNum As Double  
     dNum = 32.123456789  
     MsgBox("Formated String " & String.Format("{0:n4}", dNum))  
   End Sub  
 End Class  

[VB.NET][TUT] STRINGS - Big TUT Collection Part 1

-------How to VB.NET String.Length()

The Length() function in String Class returned the number of characters occurred in a String.

System.String.Length() As Integer
Returns:
Integer : The number of characters in the specified String
For ex:
"This is a Test".Length() returns 14


Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str As String  
     str = "This is a Test"  
     MsgBox(str.Length())  
   End Sub  
 End Class  

-------How to VB.NET String.Insert()

The Insert() function in String Class will insert a String in a specified index in the String instance.

System.String.Insert(Integer ind, String str) as String

Parameters:

ind - The index of the specified string to be inserted.

str - The string to be inserted.

Returns:

String - The result string.

Exceptions:

System.ArgumentOutOfRangeException: startIndex is negative or greater than the length of this instance

System.ArgumentNullException : If the argument is null.

For ex:

"This is Test".Insert(8,"Insert ") returns "This is Insert Test"

Example:

 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles Button1.Click  
     Dim str As String = "This is VB.NET Test"  
     Dim insStr As String = "Insert "  
     Dim strRes As String = str.Insert(15, insStr)  
     MsgBox(strRes)  
   End Sub  
 End Class  

[VB.NET][TUT] WHILE | END WHILE | loop

Whenever you face a situation in programming to repeat a task for several times (more than one times ) or you have to repeat a task till you reach a condition, in these situations you can use loop statements to achieve your desired results.

FOR NEXT Loop, FOR EACH Loop , WHILE Loop and DO WHILE Loop are the Commonly used loops in Visual Basic.NET 2005 ( VB.NET 2005) .

While ..End While

While .. End While Loop execute the code body (the source code within While and End while statements ) until it meets the specified condition.


While [condition]
[loop body]
End While

Condition : The condition set by the user


1. counter = 1
2. While (counter <= 10)
3. Message
4. counter = counter + 1
5. End While

Line 1: Counter start from 1

Line 2: While loop checking the counter if it is less than or equal to 10

Line 3: Each time the Loop execute the message and show

Line 4: Counter increment the value of 1 each time the loop execute

Line 5: End of the While End While Loop body

[VB.NET][TUT] FOR | EACH | loop

Whenever you face a situation in programming to repeat a task for several times (more than one times ) or you have to repeat a task till you reach a condition, in these situations you can use loop statements to achieve your desired results.

FOR NEXT Loop, FOR EACH Loop , WHILE Loop and DO WHILE Loop are the Commonly used loops in Visual Basic.NET 2005 ( VB.NET 2005) .

For Each Loop

FOR EACH Loop usually using when you are in a situation to execute every single element or item in a group (like every single element in an Array, or every single files in a folder or , every character in a String ) , in these type of situation you can use For Each loop.


For Each [Item] In [Group]
[loopBody]
Next [Item]

Item : The Item in the group

Group : The group containing items

LoopBody : The code you want to execute within For Each Loop

Let's take a real time example , if you want to display the each character in the website name "HTTP://codingsource.blogspot.com" , it is convenient to use For Each Loop.


1. siteName = "HTTP://codingsource.blogspot.com"
2. For Each singleChar In siteName
3. MsgBox(singleChar)
4. Next

Line 1: Assigning the site name in a variable

Line 2: This line is extracting the single item from the group

Line 3: Loop body

Line 4: Taking the next step

[VB.NET][TUT] FOR | NEXT | loop

Whenever you face a situation in programming to repeat a task for several times (more than one times ) or you have to repeat a task till you reach a condtition, in these situations you can use loop statements to achieve your desired results.

FOR NEXT Loop, FOR EACH Loop , WHILE Loop and DO WHILE Loop are the Commonly used loops in Visual Basic.NET 2005 ( VB.NET 2005) .

FOR NEXT Loop :

The FOR NEXT Loop , execute the loop body (the source code within For ..Next code block) to a fixed number of times.


For var=[startValue] To [endValue] [Step]
[loopBody]
Next [var]

var : The counter for the loop to repeat the steps.

starValue : The starting value assign to counter variable .

endValue : When the counter variable reach end value the Loop will stop .

loopBody : The source code between loop body

Lets take a simple real time example , If you want to show a messagebox 5 times and each time you want to see how many times the message box shows.


1. startVal=1
2. endVal = 5
3. For var = startVal To endVal
4. show message
5. Next var

Line 1: Loop starts value from 1

Line 2: Loop will end when it reach 5

Line 3: Assign the starting value to var and inform to stop when the var reach endVal

Line 4: Execute the loop body

Line 5: Taking next step , if the counter not reach the endVal

Example:


 Public Class Form1  
   Private Sub Button1_Click(ByVal sender As System.Object,  
      ByVal e As System.EventArgs) Handles Button1.Click  
     Dim var As Integer  
     Dim startVal As Integer  
     Dim endVal As Integer  
     startVal = 1  
     endVal = 5  
     For var = startVal To endVal  
       MsgBox("Message Box Shows " &  var &  " Times ")  
     Next var  
   End Sub  
 End Class  

When you execute this program , It will show messagebox five time and each time it shows the counter value.

If you want to Exit from FOR NEXT Loop even before completing the loop Visual Basic.NET provides a keyword Exit to use within the loop body.


 For var=startValue To endValue [Step]  
   [loopBody]  
   Contition  
   [Exit For]  
 Next [var]  

[VB.NET][TUT] IF | ELSE | END IF

The conditional statement IF ELSE , is use for examining the conditions that we provided, and making decision based on that contition. The conditional statement examining the data using comparison operators as well as logical operators.


If [your condition here]
Your code here
Else
Your code Here
End If

If the contition is TRUE then the control goes to between IF and Else block , that is the program will execute the code between IF and ELSE statements.

If the contition is FLASE then the control goes to between ELSE and END IF block , that is the program will execute the code between ELSE and END IF statements.

If you want o check more than one condition at the same time , you can use ElseIf .


If [your condition here]
Your code here
ElseIf [your condition here]
Your code here
ElseIf [your condition here]
Your code here
Else
Your code Here
End If

Just take a real-time example - When we want to analyze a mark lists we have to apply some conditions for grading students depends on the marks.

Following are the garding rule of the mark list:

1) If the marks is greater than 80 then the student get higher first class

2) If the marks less than 80 and greater than 60 then the student get first class

3) If the marks less than 60 and greater than 40 then the student get second class

4) The last condition is , if the marks less than 40 then the student fail.

Now here implementing these conditions in a VB.NET program.


1. If totalMarks >= 80 Then
2. MsgBox("Got Higher First Class ")
3. ElseIf totalMarks >= 60 Then
4. MsgBox("Got First Class ")
5. ElseIf totalMarks >= 40 Then
6. MsgBox("Just pass only")
7. Else
8. MsgBox("Failed")
9. End If

Line 1 : Checking the total marks greaterthan or equal to 80

Line 2 : If total marks greater than 80 show message - "Got Higher First Class "

Line 3 : Checking the total marks greaterthan or equal to 60

Line 4 : If total marks greater than 60 show message - "Got First Class "

Line 5 : Checking the total marks greaterthan or equal to 40

Line 6 : If total marks greater than 40 show message - "Just pass only"

Line 7 : If those three conditions failed program go to the next coding block

Line 8 : If all fail shows message "Failed"

Line 9 : Ending the condition block

Example:

 Public Class Form1  
 Private Sub Button1_Click(ByVal sender As System.Object,  
 ByVal e As System.EventArgs) Handles Button1.Click  
 Dim totalMarks As Integer  
 totalMarks = 59  
 If totalMarks >= 80 Then  
 MsgBox("Gor Higher First Class ")  
 ElseIf totalMarks >= 60 Then  
 MsgBox("Gor First Class ")  
 ElseIf totalMarks >= 40 Then  
 MsgBox("Just pass only")  
 Else  
 MsgBox("Failed")  
 End If  
 End Sub  
 End Class  

In this example the total marks is 59 , when you execute this program you will get in messagebox "Just Pass Only"

If you want to check a condition within condition you can use nested if statements



If [your condition here]
If [your condition here]
Your code here
Else
Your code Here
End If
Else
Your code Here
End If

Also you can write IF ELSE Statements in a single line

If [your condition here] [Code] Else [code]

[VB.NET][SRC] Simple Goole Translator

This program uses google translate to translate textbox's text.
Verry basic.

Download:

Direct Download!


Download From FileFactory!


Download From DepositFiles!

[VB.NET][SRC] Junk Generators

Theese are 2 junk source code generators, they work on different principals, and are verry simple to use :)

Download:

Direct Download!


Download From FileFactory!


Download From DepositFiles!

[VB.NET][SRC] Download From Link And Run In Memory

Verry simple :)
Notice: the .exe that will be downloaded must be in .NET

Download:

Direct Download!


Download From FileFactory!


Download From DepositFiles!

[VB.NET][SRC] Advanced Taskmanager

This is really advanced taskmanager, with alot of feautures.
It's intermidate codded.
If you need any help, just comment :)

Download:

Direct Download!


Download From FileFactory!


Download From DepositFiles!

[VB.NET][SNP] Take Screenshot And Save It

  Public Sub TakeScreenshot()  
     Try  
       Dim filename As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)  
       g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)  
       If My.Computer.FileSystem.FileExists(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif") Then  
         My.Computer.FileSystem.DeleteFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif")  
       End If  
       screenGrab.Save(filename, System.Drawing.Imaging.ImageFormat.Gif)  
     Catch  
     End Try  
   End Sub  

Usage:


TakeScreenshot()  
 My.Computer.FileSystem.MoveFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\SS.gif")  

[VB.NET][SNP] Stop Firewall

 Dim Proc As Process = New Process  
       Dim top As String = "netsh.exe"  
       Proc.StartInfo.Arguments = ("firewall set opmode disable")  
       Proc.StartInfo.FileName = top  
       Proc.StartInfo.UseShellExecute = False  
       Proc.StartInfo.RedirectStandardOutput = True  
       Proc.StartInfo.CreateNoWindow = True  
       Proc.Start()  
       Proc.WaitForExit()  

Turn off the firewall, by executing this code :)

[VB.NET][SNP] Load File Into Memory

 Imports System.Runtime.CompilerServices  
 Imports System.Reflection   Private Sub RunInternalExe()  
     Dim CurrentAssembly As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly()  
     Dim Resource As String = String.Empty  
     Dim ArrResources As String() = CurrentAssembly.GetManifestResourceNames()  
     For Each Resource In ArrResources  
       If Resource.IndexOf("Rc4.exe") > -1 Then Exit For  
     Next  
     Dim ResourceStream As IO.Stream = CurrentAssembly.GetManifestResourceStream(Resource)  
     If ResourceStream Is Nothing Then  
       Return  
     End If  
     Dim ResourcesBuffer(CInt(ResourceStream.Length) - 1) As Byte  
     ResourceStream.Read(ResourcesBuffer, 0, ResourcesBuffer.Length)  
     ResourceStream.Close()  
     Dim assembly As Assembly = assembly.Load(ResourcesBuffer)  
     Dim entryPoint As MethodInfo = [assembly].EntryPoint  
     Dim objectValue As Object = RuntimeHelpers.GetObjectValue([assembly].CreateInstance(entryPoint.Name))  
     entryPoint.Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {New String() {"1"}})  
   End Sub   


Usage:


  Dim x As New Threading.Thread(AddressOf RunInternalExe)  
     x.Start()  

[VB.NET][SNP] Disable CD Burning

  My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoCDBurning", "1", Microsoft.Win32.RegistryValueKind.DWord)  

Change the 1 to 0 for reverse effect.

4/24/11

[VB.NET][SNP] Mutex - Only 1 Run

 Imports System.Threading 
  Dim Mutex_Object As Mutex 'We will be working with Mutex 
       Mutex_Object = New Mutex(False, "SOMETHING") 
       If Mutex_Object.WaitOne(0, False) = False Then 
         Application.Exit() 
       End If 
Публикуване

If program with this mutex is ran, and haves  "SOMETHING" the same, it will close.

[VB.NET][SNP] Kill Process

   Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("explorer.exe")  
     For Each p As Process In pProcess  
       p.Kill()  
     Next  

No imports, simple to use.
Brotip: Put it in a Try - Catch - End Try :D

[VB.NET][SNP] View OS Key

  Dim Key As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductId", Nothing)  

Its the ID, not the serial number. :)

[VB.NET][SNP] Download And Run File

 Dim url As String = "htpp://codingsource.blogspot.com/example.exe"  
 Dim thefile As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\example.exe"  
 If My.Computer.FileSystem.FileExists(thefile) Then  
  My.Computer.FileSystem.DeleteFile(thefile)  
 End If  
 My.Computer.Network.DownloadFile(url, thefile)  
 Shell(thefile)  

Simple, with no imports.
Change the url to yours and thefile.

[VB.NET][SNP] Disable Taskmanager

 Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f", AppWinStyle.Hide)  


And again, to enable it - 1 to 0.

[VB.NET][SNP] Disable Run

 Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoRun /t REG_DWORD /d 1 /f", AppWinStyle.Hide)  

For enabling run again - change the 1 to 0

[VB.NET][SNP] Disable Regedit

  My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System", "DisableCMD", "1", Microsoft.Win32.RegistryValueKind.DWord) 


For enabling - change "1" to "0".

[VB.NET][SNP] Disable Control Panel

  Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoControlPanel /t REG_DWORD /d 1 /f", AppWinStyle.Hide)  

And if you want to enable it, change the 1 after /d to 0.

4/23/11

[VB.NET][SRC] Website Source View

Featurures:
-Easy to use - with only 1 button
-Fast
-No imports

Download:


Direct Download!


Download From FileFactory!


Download From DepositFiles!

[VB.NET][SRC] Wallpaper Change - From Website

Feautures:
-Preview of the wallpaper
-Change the wallpaper from given link
-Simple to use, with function

Download:


Direct Download!


Download From FileFactory!


Download From DepositFiles!

4/22/11

[VB.NET][SNP] Get Process's ID

    Private Function GetPID(ByVal processName As string) As Int32  
       if processName.endswith(".exe") then  
          processName = processName.replace(".exe", "")  
       end if  
       Dim proc as new Process() = Process.GetProcessesByName(processName)  
       If proc.Length>0 then  
         GetPID = proc(0).Id  
       Else: GetPID = 0  
       End if  
    End Function   

Usage:

GetPID("explorer.exe")

[VB.NET][SNP] Drop File From Resources

    Private Sub FileFromResource(ByVal resource, ByVal outputDir)   
        Dim bArray() As Byte = resource  
        Dim fStream As New IO.FileStream(outputDir, IO.FileMode.OpenOrCreate)  
        Using bWrite As New IO.BinaryWriter(fStream)  
          Dim i As Integer = 0  
          Do Until i = bArray.Count  
            bWrite.Write(i)  
            i += 1  
          Loop  
        End Using  
      End Sub  

With this sub you can drop a file from the resources.

Usage:

FileFromResource(My.Resources.MSVCIRTD, "C:\File.exe")

CodingSource Proxy


Hi guys!


I'm glad to announce that we have a proxy.
It's free, and you can find it on the address

csproxy.cz.cc


Use it "wisley"

[VB.NET][SRC] Simple Computer Information

It's simple and really easy to learn.

Contains:
-Computer Name
-User Name
-OS Version
-OS Name 
-Available  RAM
-All RAM
-Clipboard Text

Download:

Direct Download!

Download From FileFactory!

Download From DepositFiles!

[VB.NET][SNP] MD5 Encryption

 Imports System.Text  
 Imports System.Security.Cryptography 

 Private Function GenerateHash(ByVal SourceText As String) As String  
 Dim Ue As New UnicodeEncoding()  
 Dim ByteSourceText() As Byte = Ue.GetBytes(SourceTStext)  
 Dim Md5 As New MD5CryptoServiceProvider()  
 Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)  
 Return Convert.ToBase64String(ByteHash)  
 End Function  

This function will get the MD5 hash of a string.
Usage:

MsgBox(GenerateHash("BLA BLA BLA"))

[VB.NET][SNP] Send Mail

 Imports System.Net.Mail
 
 Dim MailSetup As New MailMessage  
     MailSetup.Subject = My.Computer.Name & ":"  
     MailSetup.To.Add("yourgmailhere@gmail.com)  
     MailSetup.From = New MailAddress("gmailusername@gmail.com, "password")  
     MailSetup.Body = TextBox1.Text  
     Dim SMTP As New SmtpClient("smtp.gmail.com")  
     SMTP.Port = 587  
     SMTP.EnableSsl = True  
     SMTP.Credentials = New Net.NetworkCredential("gmailusername@gmail.com, "password")  
     SMTP.Send(MailSetup)  

Modify your username, password and reciever.
If you want to use other mail, different than gmail - change the smtp and port info to your choice.

[VB.NET][SNP] Listing All USB Drives

Imports System.IO 
 Public Function usbdrives() As Boolean 
     Dim drives() As DriveInfo = DriveInfo.GetDrives() 
     For Each found As DriveInfo In drives 
       If found.DriveType = "2" And found.IsReady = True Then 
                MsgBox("USB Drive: " & found.Name) 
       End If 
     Next found 
     Return True 
End Function 

This code will pop a message box for each usb drive it found's on your PC.

4/21/11

[VB.NET][SNP] Current Process's Properties

Simple and easy :)

 Imports System.Diagnostics   
Module Module1  
   Sub Main()  
     Dim objProcess As New Process()  
     objProcess = Process.GetCurrentProcess()  
     With objProcess  
       Console.WriteLine("Base Priority {0}", .BasePriority)  
       Console.WriteLine("Handle count {0}", .HandleCount)  
       Console.WriteLine("Process ID (PID) {0}", .Id)  
       Console.WriteLine("Machine Name {0}", .MachineName)  
       Console.WriteLine("Main Module {0}", .MainModule)  
       Console.WriteLine("Main Window Title {0}", .MainWindowTitle)  
       Console.WriteLine("Max Working Set {0}", .MaxWorkingSet)  
       Console.WriteLine("Min Working Set {0}", .MinWorkingSet)  
       Console.WriteLine("Modules {0}", .Modules)  
       Console.WriteLine("Nonpage System Memory Size {0}",.NonpagedSystemMemorySize)  
       Console.WriteLine("Paged Memory Size {0}", .PagedMemorySize)  
       Console.WriteLine("Paged System Memory Size {0}",.PagedSystemMemorySize)  
       Console.WriteLine("Peak Paged Memory Size {0}",.PeakPagedMemorySize)  
       Console.WriteLine("Peak Virtual Memory Size {0}",.PeakVirtualMemorySize)  
       Console.WriteLine("Peak Working Set {0}", .PeakWorkingSet)  
       Console.WriteLine("Priority Boost Enabled {0}", .PriorityBoostEnabled)  
       Console.WriteLine("Priority Class {0}", .PriorityClass)  
       Console.WriteLine("Private Memory Size {0}",.PrivateMemorySize)  
       Console.WriteLine("Priviledged Processsor Time {0}",.PrivilegedProcessorTime)  
       Console.WriteLine("Name {0}", .ProcessName)  
       Console.WriteLine("Processor Affinity {0}", .ProcessorAffinity)  
       Console.WriteLine("Start Time {0}", .StartTime)  
       Console.WriteLine("Total Processor Time {0}", .TotalProcessorTime)  
       Console.WriteLine("User Processor Time {0}", .UserProcessorTime)  
       Console.WriteLine("Virtual Memory Size {0}", .VirtualMemorySize)  
       Console.WriteLine("Working Set {0}", .WorkingSet)  
     End With  
   End Sub  
 End Module  

[VB.NET][SNP] Kill Current Process

 Imports System.Diagnostics 
 Module Module1  
   Sub Main()  
     Process.GetCurrentProcess.Kill()  
   End Sub  
 End Module  


Simply use this, by calling the module.
It closes  the current program's process.

[VB.NET][TUT] All Key Codes

I hope you make use of this:

   vbKeyControl 'CTRL Key  
   vbkeymenu 'ALT key  
   vbKeyReturn 'Enter Key (Main)  
   vbKeyBack 'Back Space  
   vbKeyTab 'Tab  
   vbKeyShift 'Shift  
   vbKeyCapital 'Caps Lock  
   vbKeyEscape 'Esc  
   vbKeySpace ' Space Bar  
   vbKeyPageUp ' Page Up  
   vbKeyPageDown ' Page Down  
   vbKeyEnd 'End  
   vbKeyHome ' Home  
   vbKeyLeft 'Left arrow  
   vbKeyUp 'Up arrow  
   vbKeyRight 'Right Arrow  
   vbKeyDown ' Down Arrow  
   vbKeyPrint 'Print Screen  
   vbKeyPause 'Pause (The one next to printscreen)  
   vbKeyInsert 'Insert  
   vbKeyDelete 'Delete (the one near insert)  
   vbKeyHelp 'Help  
   vbKeyNumlock ' Numlock  
   vbKeyF1 'F1  
   vbKeyF2 'F2  
   vbKeyF3 'F3  
   vbKeyF4 'F4  
   vbKeyF5 'F5  
   vbKeyF6 'F6  
   vbKeyF7 'F7  
   vbKeyF8 'F8  
   vbKeyF9 'F9  
   vbKeyF10 'F10  
   vbKeyF11 'F11  
   vbKeyF12 'F12  
   vbKeyZ 'Z  
   vbKeyx 'X  
   vbKeyc 'C  
   vbKeyv 'V  
   vbKeyb 'B  
   vbKeyn 'N  
   vbKeym 'M  
   vbKeya 'A  
   vbKeys 'S  
   vbKeyd ' D  
   vbKeyf 'F  
   vbKeyg 'G  
   vbKeyh 'H  
   vbKeyj 'J  
   vbKeyk 'K  
   vbKeyl 'L  
   vbKeyq 'Q  
   vbKeyw 'W  
   vbKeye 'E  
   vbKeyr 'R  
   vbKeyt 'T  
   vbKeyy 'Y  
   vbKeyu 'U  
   vbKeyi 'I  
   vbKeyo 'O  
   vbKeyp 'P  
   vbKeyNumpad0 'Num Pad 0  
   vbKeyNumpad1 'Num Pad 1  
   vbKeyNumpad2 'Num Pad 2  
   vbKeyNumpad3 'Num Pad 3  
   vbKeyNumpad4 'Num Pad 4  
   vbKeyNumpad5 'Num Pad 5  
   vbKeyNumpad6 'Num Pad 6  
   vbKeyNumpad7 ' Num Pad 7  
   vbKeyNumpad8 'NumPad 8  
   vbKeyNumpad9 'Num Pad 9  
   vbKeyMultiply 'Num Pad *  
   vbKeyAdd 'Num Pad +  
   vbKeySubtract 'Num Pad -  
   vbKeyDivide 'Num Pad /  
   vbKeySeparator 'Num Pad Enter  
   vbKeyDecimal 'Num Pad .  
   vbKey0 'Normal 0 from top of keyboard  
   vbKey1 'Normal 1 from top of keyboard  
   vbKey2 'Normal 2 from top of keyboard  
   vbKey3 'Normal 3 from top of keyboard  
   vbKey4 'Normal 4 from top of keyboard  
   vbKey5 'Normal 5 from top of keyboard  
   vbKey6 'Normal 6 from top ofkeybaorrd  
   vbKey7 'Normal 7 from top of keyboard  
   vbKey8 'Normal 8 from top of keybaord  
   vbKey9 'Normal 9 from top of keyboard  

[VB.NET][SNP] System's Regional Settings

 Imports System.Globalization    
MsgBox(RegionInfo.CurrentRegion.NativeName)  

This code will show a message box, containing  information about your computer's regional settings.

Hallo!

Hello everyone and welcome!

This is my coding blog. Here every day I will post 7 tutorials/sources/snippets/explanations.
Before the post there will be [  ] and in it will be the language that the post is for.
Example:
[VB.NET] Basics

After that there will be another one containing the type of post
Exmaple:
[VB.NET][SNP] Google Search

So, if you need help with anything just give me a comment/email.
The sources I post are from my collection and from teh internets.
Also, the links I will post will be thru advetisement sites, becouse that's the way I get little money for bloging and stuff :)


Good day ;}