Support Forums

Full Version: Source Codes For Beginners Pt.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Form2

Code:
Form2.show
me.close


Auto Typer

Code:
Public Class Form1

    Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If CheckBox1.Checked = True Then
            On Error Resume Next
            SendKeys.Send(TextBox1.Text)
            On Error Resume Next
            SendKeys.Send("{Enter}")
        End If
        If CheckBox2.Checked = True Then
            On Error Resume Next
            SendKeys.Send(TextBox2.Text)
            On Error Resume Next
            SendKeys.Send("{Enter}")
        End If
        If CheckBox3.Checked = True Then
            On Error Resume Next
            SendKeys.Send(TextBox3.Text)
            On Error Resume Next
            SendKeys.Send("{Enter}")
        End If
        If CheckBox4.Checked = True Then
            On Error Resume Next
            SendKeys.Send(TextBox4.Text)
            On Error Resume Next
            SendKeys.Send("{Enter}")
        End If
        If CheckBox5.Checked = True Then
            On Error Resume Next
            SendKeys.Send(TextBox5.Text)
            On Error Resume Next
            SendKeys.Send("{Enter}")
        End If
        Timer1.Start()

    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Stop()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End
    End Sub



MD5 From File

Code:
Public Function MD5CalcFile(ByVal strPath As String) As String

        Dim objReader As System.IO.Stream
        Dim objMD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
        Dim arrHash() As Byte

        ' open file (as read-only)
        objReader = New System.IO.FileStream(strPath, IO.FileMode.Open, IO.FileAccess.Read)

        ' hash contents of this stream
        arrHash = objMD5.ComputeHash(objReader)

        ' thanks objects
        objReader.Close()
        objReader = Nothing
        objMD5 = Nothing

        ' return formatted hash
        Return ByteArrayToString(arrHash)

    End Function

    ' utility function to convert a byte array into a hex string
    Private Function ByteArrayToString(ByVal arrInput() As Byte) As String

        Dim strOutput As New System.Text.StringBuilder(arrInput.Length)

        For i As Integer = 0 To arrInput.Length - 1
            strOutput.Append(arrInput(i).ToString("X2"))
        Next

        Return strOutput.ToString().ToLower

    End Function

Listbox Auto Scroll

Code:
ListBox1.TopIndex = ListBox1.Items.Count - 1


Message box

Code:
MsgBox ("Message here", style.here, "Title here")


Send Email

Code:
Dim SetUPMAIL As New MailMessage()
Try
SetUPMAIL.From = New MailAddress("YOURGOOGLEEMAIL@googlemail.com")
SetUPMAIL.To.Add("YOUREMAIL@ANYHOST.COM")
SetUPMAIL.Subject = "Subject"
SetUPMAIL.Body = "Body"
Dim SMTP As New SmtpClient("smtp.googlemail.com" or "smtp.gmail.com")
SMTP.Port = 587
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("YOURGOOGLEEMAIL@googlemail.com", "GOOGLEMAILPASSWORD")

SMTP.Send(SetUPMAIL)
Nice codes Smile I know most of these already but they are a quick guide.
Thanks!!

-Pycomoneky
(02-23-2010, 08:33 PM)pycomonkey Wrote: [ -> ]Thanks!!

-Pycomoneky

No Problem Just here To share..LOL
Very nice share...
Thanks
An auto typer is nice . Very nice share
Pretty random share Tongue

Will probably help some beginners. Good work.
Nice share man! Very usefull for beginners! Smile
Thanx I like this one.
Code:
Form2.show
me.close
nice tut for beginner Smile
thank you for sharing this