02-21-2010, 09:46 PM
These are just some sources i had found on my computer. (credit to their owners)
Start Process
External Ip
Fade in (Form Effect)
Type Writer (Text Effect)
Progress Bar
Rc4 Text Encryption
I would Like +Rep for sharing this but i am not allowed to ask..
Start Process
Code:
Process.Start("www.TechnicForums.com")
External Ip
Code:
Public Class iMe
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Husam As New System.Net.WebClient
Dim ip As String
ip = System.Text.Encoding.ASCII.GetString(( _
Husam.DownloadData("Http://whatismyip.com/automation/n09230945.asp")))
TextBox1.Text = ip
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Me.Close()
End Sub
End Class
Fade in (Form Effect)
Code:
Delegate Sub FadeIn_Delegate(ByRef [Form] As Form, ByRef [TimeMs] As Double, ByRef [ToOpacity] As Double)
Public Sub FadeIn(ByRef whd As Form, ByRef ms As Double, ByRef ToOpacity As Double)
Dim etime As DateTime
If whd.InvokeRequired Then
Dim d As New FadeIn_Delegate(AddressOf FadeIn)
whd.Invoke(d, New Object() {whd, ms, ToOpacity})
Else
Try
While whd.Opacity < ToOpacity
whd.Opacity += 0.01
If whd.Opacity = ToOpacity Then Exit While
etime = Now.AddMilliseconds(ms)
While Now < etime
System.Windows.Forms.Application.DoEvents()
End While
End While
Catch ex As Exception
Exit Try
End Try
End If
End Sub
Type Writer (Text Effect)
Code:
Public Class Form1
Dim i As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 300 'Typing Speed.
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim strtext As String = TextBox1.Text
Dim textarray() As Char = strtext.ToCharArray()
If i = Len(strtext) Then
Timer1.Stop()
Me.Close()
Else
RichTextBox1.AppendText(textarray(i))
i = i + 1
End If
End Sub
End Class
Progress Bar
Code:
ProgressBar1.Increment(textbox1.text)
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
MsgBox("Progress Bar Loaded 100%")
ProgressBar1.Increment(-100)
Timer1.Interval = (TextBox2.Text)
End If
Rc4 Text Encryption
Code:
Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim cipher As New StringBuilder
Dim returnCipher As String = String.Empty
Dim sbox As Integer() = New Integer(256) {}
Dim key As Integer() = New Integer(256) {}
Dim intLength As Integer = password.Length
Dim a As Integer = 0
While a <= 255
Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
sbox(a) = a
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
Dim x As Integer = 0
Dim b As Integer = 0
While b <= 255
x = (x + sbox(b) + key(b)) Mod 256
Dim tempSwap As Integer = sbox(b)
sbox(b) = sbox(x)
sbox(x) = tempSwap
System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
End While
a = 1
While a <= message.Length
Dim itmp As Integer = 0
i = (i + 1) Mod 256
j = (j + sbox(i)) Mod 256
itmp = sbox(i)
sbox(i) = sbox(j)
sbox(j) = itmp
Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
itmp = Asc(ctmp)
Dim cipherby As Integer = itmp Xor k
cipher.Append(Chr(cipherby))
System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
End While
returnCipher = cipher.ToString
cipher.Length = 0
Return returnCipher
End Function
I would Like +Rep for sharing this but i am not allowed to ask..