Form1.vb
上传用户:websnack
上传日期:2022-08-01
资源大小:53k
文件大小:29k
- Imports System.IO
- Public Class Form1
- Inherits System.Windows.Forms.Form
- #Region " Windows Form Designer generated code "
- Public Sub New()
- MyBase.New()
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
- 'Add any initialization after the InitializeComponent() call
- End Sub
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
- Friend WithEvents ListBox2 As System.Windows.Forms.ListBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Button1 As System.Windows.Forms.Button
- Friend WithEvents Button2 As System.Windows.Forms.Button
- Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
- Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
- Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
- Friend WithEvents Button5 As System.Windows.Forms.Button
- Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents Button6 As System.Windows.Forms.Button
- Friend WithEvents TabPage3 As System.Windows.Forms.TabPage
- Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
- Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
- Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents Label6 As System.Windows.Forms.Label
- Friend WithEvents Label7 As System.Windows.Forms.Label
- Friend WithEvents Button7 As System.Windows.Forms.Button
- Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu
- Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
- Friend WithEvents ContextMenu2 As System.Windows.Forms.ContextMenu
- Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
- Friend WithEvents ContextMenu3 As System.Windows.Forms.ContextMenu
- Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem9 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem10 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem11 As System.Windows.Forms.MenuItem
- Friend WithEvents MenuItem12 As System.Windows.Forms.MenuItem
- Friend WithEvents UserControl11 As Show.UserControl1
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.ListBox1 = New System.Windows.Forms.ListBox()
- Me.ContextMenu2 = New System.Windows.Forms.ContextMenu()
- Me.MenuItem5 = New System.Windows.Forms.MenuItem()
- Me.MenuItem7 = New System.Windows.Forms.MenuItem()
- Me.MenuItem9 = New System.Windows.Forms.MenuItem()
- Me.MenuItem11 = New System.Windows.Forms.MenuItem()
- Me.ListBox2 = New System.Windows.Forms.ListBox()
- Me.ContextMenu3 = New System.Windows.Forms.ContextMenu()
- Me.MenuItem6 = New System.Windows.Forms.MenuItem()
- Me.MenuItem8 = New System.Windows.Forms.MenuItem()
- Me.MenuItem10 = New System.Windows.Forms.MenuItem()
- Me.MenuItem12 = New System.Windows.Forms.MenuItem()
- Me.Label1 = New System.Windows.Forms.Label()
- Me.Label2 = New System.Windows.Forms.Label()
- Me.Button1 = New System.Windows.Forms.Button()
- Me.Button2 = New System.Windows.Forms.Button()
- Me.TabControl1 = New System.Windows.Forms.TabControl()
- Me.TabPage1 = New System.Windows.Forms.TabPage()
- Me.Button5 = New System.Windows.Forms.Button()
- Me.TextBox2 = New System.Windows.Forms.TextBox()
- Me.TextBox1 = New System.Windows.Forms.TextBox()
- Me.Label3 = New System.Windows.Forms.Label()
- Me.Label4 = New System.Windows.Forms.Label()
- Me.Button6 = New System.Windows.Forms.Button()
- Me.UserControl11 = New Show.UserControl1()
- Me.TabPage2 = New System.Windows.Forms.TabPage()
- Me.ContextMenu1 = New System.Windows.Forms.ContextMenu()
- Me.MenuItem1 = New System.Windows.Forms.MenuItem()
- Me.MenuItem2 = New System.Windows.Forms.MenuItem()
- Me.MenuItem3 = New System.Windows.Forms.MenuItem()
- Me.MenuItem4 = New System.Windows.Forms.MenuItem()
- Me.TabPage3 = New System.Windows.Forms.TabPage()
- Me.Button7 = New System.Windows.Forms.Button()
- Me.Label5 = New System.Windows.Forms.Label()
- Me.TextBox3 = New System.Windows.Forms.TextBox()
- Me.Label6 = New System.Windows.Forms.Label()
- Me.TextBox4 = New System.Windows.Forms.TextBox()
- Me.Label7 = New System.Windows.Forms.Label()
- Me.TextBox5 = New System.Windows.Forms.TextBox()
- Me.TabControl1.SuspendLayout()
- Me.TabPage1.SuspendLayout()
- Me.TabPage2.SuspendLayout()
- Me.TabPage3.SuspendLayout()
- Me.SuspendLayout()
- '
- 'ListBox1
- '
- Me.ListBox1.ContextMenu = Me.ContextMenu2
- Me.ListBox1.Location = New System.Drawing.Point(8, 40)
- Me.ListBox1.Name = "ListBox1"
- Me.ListBox1.Size = New System.Drawing.Size(112, 160)
- Me.ListBox1.Sorted = True
- Me.ListBox1.TabIndex = 0
- '
- 'ContextMenu2
- '
- Me.ContextMenu2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem5, Me.MenuItem7, Me.MenuItem9, Me.MenuItem11})
- '
- 'MenuItem5
- '
- Me.MenuItem5.Index = 0
- Me.MenuItem5.Text = "Delete"
- '
- 'MenuItem7
- '
- Me.MenuItem7.Index = 1
- Me.MenuItem7.Text = "Hide"
- '
- 'MenuItem9
- '
- Me.MenuItem9.Index = 2
- Me.MenuItem9.Text = "Open"
- '
- 'MenuItem11
- '
- Me.MenuItem11.Index = 3
- Me.MenuItem11.Text = "Rename"
- '
- 'ListBox2
- '
- Me.ListBox2.ContextMenu = Me.ContextMenu3
- Me.ListBox2.Location = New System.Drawing.Point(160, 40)
- Me.ListBox2.Name = "ListBox2"
- Me.ListBox2.Size = New System.Drawing.Size(112, 160)
- Me.ListBox2.Sorted = True
- Me.ListBox2.TabIndex = 1
- '
- 'ContextMenu3
- '
- Me.ContextMenu3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem6, Me.MenuItem8, Me.MenuItem10, Me.MenuItem12})
- '
- 'MenuItem6
- '
- Me.MenuItem6.Index = 0
- Me.MenuItem6.Text = "Delete"
- '
- 'MenuItem8
- '
- Me.MenuItem8.Index = 1
- Me.MenuItem8.Text = "Show"
- '
- 'MenuItem10
- '
- Me.MenuItem10.Index = 2
- Me.MenuItem10.Text = "Open"
- '
- 'MenuItem12
- '
- Me.MenuItem12.Index = 3
- Me.MenuItem12.Text = "Rename"
- '
- 'Label1
- '
- Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Label1.Location = New System.Drawing.Point(8, 8)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(112, 24)
- Me.Label1.TabIndex = 2
- Me.Label1.Text = "Visible"
- Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
- '
- 'Label2
- '
- Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Label2.Location = New System.Drawing.Point(160, 8)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(112, 24)
- Me.Label2.TabIndex = 3
- Me.Label2.Text = "Hidden"
- Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
- '
- 'Button1
- '
- Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Button1.Location = New System.Drawing.Point(128, 72)
- Me.Button1.Name = "Button1"
- Me.Button1.Size = New System.Drawing.Size(24, 24)
- Me.Button1.TabIndex = 4
- Me.Button1.Text = "<"
- '
- 'Button2
- '
- Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Button2.Location = New System.Drawing.Point(128, 136)
- Me.Button2.Name = "Button2"
- Me.Button2.Size = New System.Drawing.Size(24, 24)
- Me.Button2.TabIndex = 5
- Me.Button2.Text = ">"
- '
- 'TabControl1
- '
- Me.TabControl1.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabPage1, Me.TabPage2, Me.TabPage3})
- Me.TabControl1.HotTrack = True
- Me.TabControl1.ImeMode = System.Windows.Forms.ImeMode.On
- Me.TabControl1.Location = New System.Drawing.Point(8, 8)
- Me.TabControl1.Name = "TabControl1"
- Me.TabControl1.SelectedIndex = 0
- Me.TabControl1.Size = New System.Drawing.Size(288, 240)
- Me.TabControl1.TabIndex = 8
- '
- 'TabPage1
- '
- Me.TabPage1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button5, Me.TextBox2, Me.TextBox1, Me.Label3, Me.Label4, Me.Button6, Me.UserControl11})
- Me.TabPage1.Location = New System.Drawing.Point(4, 22)
- Me.TabPage1.Name = "TabPage1"
- Me.TabPage1.Size = New System.Drawing.Size(280, 214)
- Me.TabPage1.TabIndex = 0
- Me.TabPage1.Text = "LogIn"
- '
- 'Button5
- '
- Me.Button5.Location = New System.Drawing.Point(45, 121)
- Me.Button5.Name = "Button5"
- Me.Button5.Size = New System.Drawing.Size(88, 24)
- Me.Button5.TabIndex = 13
- Me.Button5.Text = "SignIn"
- '
- 'TextBox2
- '
- Me.TextBox2.Location = New System.Drawing.Point(133, 89)
- Me.TextBox2.Name = "TextBox2"
- Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(42)
- Me.TextBox2.Size = New System.Drawing.Size(104, 20)
- Me.TextBox2.TabIndex = 12
- Me.TextBox2.Text = ""
- '
- 'TextBox1
- '
- Me.TextBox1.Location = New System.Drawing.Point(133, 65)
- Me.TextBox1.Name = "TextBox1"
- Me.TextBox1.Size = New System.Drawing.Size(104, 20)
- Me.TextBox1.TabIndex = 11
- Me.TextBox1.Text = ""
- '
- 'Label3
- '
- Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label3.Location = New System.Drawing.Point(45, 89)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(72, 16)
- Me.Label3.TabIndex = 10
- Me.Label3.Text = "Password"
- '
- 'Label4
- '
- Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label4.Location = New System.Drawing.Point(45, 65)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(72, 16)
- Me.Label4.TabIndex = 9
- Me.Label4.Text = "UserName"
- '
- 'Button6
- '
- Me.Button6.Location = New System.Drawing.Point(149, 121)
- Me.Button6.Name = "Button6"
- Me.Button6.Size = New System.Drawing.Size(88, 24)
- Me.Button6.TabIndex = 14
- Me.Button6.Text = "SignOut"
- '
- 'UserControl11
- '
- Me.UserControl11.Location = New System.Drawing.Point(26, 56)
- Me.UserControl11.Name = "UserControl11"
- Me.UserControl11.Size = New System.Drawing.Size(232, 104)
- Me.UserControl11.TabIndex = 15
- '
- 'TabPage2
- '
- Me.TabPage2.ContextMenu = Me.ContextMenu1
- Me.TabPage2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label1, Me.Label2, Me.ListBox2, Me.ListBox1, Me.Button1, Me.Button2})
- Me.TabPage2.Location = New System.Drawing.Point(4, 22)
- Me.TabPage2.Name = "TabPage2"
- Me.TabPage2.Size = New System.Drawing.Size(280, 214)
- Me.TabPage2.TabIndex = 1
- Me.TabPage2.Text = "Events"
- '
- 'ContextMenu1
- '
- Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2, Me.MenuItem3, Me.MenuItem4})
- '
- 'MenuItem1
- '
- Me.MenuItem1.Index = 0
- Me.MenuItem1.Text = "Hide All"
- '
- 'MenuItem2
- '
- Me.MenuItem2.Index = 1
- Me.MenuItem2.Text = "Show All"
- '
- 'MenuItem3
- '
- Me.MenuItem3.Index = 2
- Me.MenuItem3.Text = "Refresh"
- '
- 'MenuItem4
- '
- Me.MenuItem4.Index = 3
- Me.MenuItem4.Text = "Exit"
- '
- 'TabPage3
- '
- Me.TabPage3.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button7, Me.Label5, Me.TextBox3, Me.Label6, Me.TextBox4, Me.Label7, Me.TextBox5})
- Me.TabPage3.Location = New System.Drawing.Point(4, 22)
- Me.TabPage3.Name = "TabPage3"
- Me.TabPage3.Size = New System.Drawing.Size(280, 214)
- Me.TabPage3.TabIndex = 2
- Me.TabPage3.Text = "Directories"
- '
- 'Button7
- '
- Me.Button7.Location = New System.Drawing.Point(96, 152)
- Me.Button7.Name = "Button7"
- Me.Button7.Size = New System.Drawing.Size(104, 24)
- Me.Button7.TabIndex = 15
- Me.Button7.Text = "Apply"
- '
- 'Label5
- '
- Me.Label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label5.Location = New System.Drawing.Point(24, 40)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(80, 24)
- Me.Label5.TabIndex = 12
- Me.Label5.Text = "Base Directory"
- Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
- '
- 'TextBox3
- '
- Me.TextBox3.Location = New System.Drawing.Point(122, 42)
- Me.TextBox3.Name = "TextBox3"
- Me.TextBox3.Size = New System.Drawing.Size(136, 20)
- Me.TextBox3.TabIndex = 9
- Me.TextBox3.Text = "misc"
- '
- 'Label6
- '
- Me.Label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label6.Location = New System.Drawing.Point(23, 72)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(80, 24)
- Me.Label6.TabIndex = 13
- Me.Label6.Text = "Recyler1"
- Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
- '
- 'TextBox4
- '
- Me.TextBox4.Location = New System.Drawing.Point(121, 74)
- Me.TextBox4.Name = "TextBox4"
- Me.TextBox4.Size = New System.Drawing.Size(136, 20)
- Me.TextBox4.TabIndex = 10
- Me.TextBox4.Text = "Recycle Bin"
- '
- 'Label7
- '
- Me.Label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.Label7.Location = New System.Drawing.Point(23, 104)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(80, 24)
- Me.Label7.TabIndex = 14
- Me.Label7.Text = "Recyler2"
- Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
- '
- 'TextBox5
- '
- Me.TextBox5.Location = New System.Drawing.Point(121, 106)
- Me.TextBox5.Name = "TextBox5"
- Me.TextBox5.Size = New System.Drawing.Size(136, 20)
- Me.TextBox5.TabIndex = 11
- Me.TextBox5.Text = "recylced"
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
- Me.BackColor = System.Drawing.Color.Gold
- Me.ClientSize = New System.Drawing.Size(304, 254)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabControl1})
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
- Me.MaximizeBox = False
- Me.Name = "Form1"
- Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
- Me.Text = "Events Program"
- Me.TabControl1.ResumeLayout(False)
- Me.TabPage1.ResumeLayout(False)
- Me.TabPage2.ResumeLayout(False)
- Me.TabPage3.ResumeLayout(False)
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Dim currfldr, fldr As DirectoryInfo
- Dim k As Directory
- Dim n As String
- Dim j As String
- Dim j2 As String
- Public Sub cr(ByVal path As String)
- currfldr.Create()
- currfldr.Attributes = FileAttributes.Hidden + FileAttributes.System
- FileOpen(1, path & "Desktop.ini" _
- , OpenMode.Output)
- Print(1, "[.ShellClassInfo]" & vbCrLf & _
- "CLSID={645FF040-5081-101B-9F08-00AA002F954E}")
- FileClose(1)
- End Sub
- Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- On Error Resume Next
- elements(False)
- TabPage2.Enabled = False
- End Sub
- Public Sub elements(ByVal s As Boolean)
- Label1.Visible = s
- Label2.Visible = s
- ListBox1.Visible = s
- ListBox2.Visible = s
- Button1.Visible = s
- Button2.Visible = s
- Label5.Visible = s
- Label6.Visible = s
- Label7.Visible = s
- TextBox3.Visible = s
- TextBox4.Visible = s
- TextBox5.Visible = s
- Button7.Visible = s
- End Sub
- Public Sub fill()
- n = New String(TextBox3.Text.ToLower)
- j = New String(TextBox4.Text.ToLower)
- j2 = New String(TextBox5.Text.ToLower)
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n)
- If currfldr.Exists = False Then
- currfldr.Create()
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j)
- cr(currfldr.FullName)
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2)
- cr(currfldr.FullName)
- Else
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j)
- If currfldr.Exists = False Then
- cr(currfldr.FullName)
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2)
- cr(currfldr.FullName)
- Else
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2)
- If currfldr.Exists = False Then
- currfldr.Create()
- currfldr.Attributes = FileAttributes.Hidden + FileAttributes.System
- FileOpen(1, Application.StartupPath & "" & n & "" & j & "" & j2 & "Desktop.ini" _
- , OpenMode.Output)
- Print(1, "[.ShellClassInfo]" & vbCrLf & _
- "CLSID={645FF040-5081-101B-9F08-00AA002F954E}")
- FileClose(1)
- End If
- End If
- End If
- currfldr = New DirectoryInfo(Application.StartupPath)
- If currfldr.Exists Then
- For Each fldr In currfldr.GetDirectories
- If fldr.Exists And fldr.Name.ToLower <> n.ToLower Then
- ListBox1.Items.Add(fldr.ToString)
- End If
- Next fldr
- End If
- currfldr = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2)
- If currfldr.Exists Then
- For Each fldr In currfldr.GetDirectories
- If fldr.Exists Then
- ListBox2.Items.Add(fldr.ToString)
- Else : Exit Sub
- End If
- Next fldr
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- If ListBox1.SelectedIndex >= 0 Then
- Dim dir As DirectoryInfo = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox1.SelectedItem)
- If Not dir.Exists Then
- k.Move(Application.StartupPath & "" & ListBox1.SelectedItem, _
- Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox1.SelectedItem)
- ListBox2.Items.Add(ListBox1.SelectedItem)
- ListBox1.Items.Remove(ListBox1.SelectedItem)
- Else
- MsgBox("Directory already exists in destination folder")
- End If
- End If
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If ListBox2.SelectedIndex >= 0 Then
- Dim dir As DirectoryInfo = New DirectoryInfo(Application.StartupPath & "" & ListBox2.SelectedItem)
- If Not dir.Exists Then
- k.Move(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox2.SelectedItem, _
- Application.StartupPath & "" & ListBox2.SelectedItem)
- ListBox1.Items.Add(ListBox2.SelectedItem)
- ListBox2.Items.Remove(ListBox2.SelectedItem)
- Else
- MsgBox("Directory already exists in destination folder")
- End If
- End If
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- If TextBox1.Text = "Simon" And TextBox2.Text = "ShiPassword" Then
- ListBox1.Items.Clear()
- ListBox2.Items.Clear()
- On Error Resume Next
- elements(True)
- TextBox1.Text = ""
- TextBox2.Text = ""
- fill()
- TabPage2.Enabled = True
- TabControl1.SelectedTab = TabPage2
- End If
- End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
- elements(False)
- ListBox1.Items.Clear()
- ListBox2.Items.Clear()
- TabPage2.Enabled = False
- End Sub
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
- ListBox1.Items.Clear()
- ListBox2.Items.Clear()
- fill()
- End Sub
- Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
- Dim i, m As Integer
- m = 0
- Dim dir As DirectoryInfo
- For i = 0 To ListBox1.Items.Count - 1
- dir = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox1.Items.Item(m))
- If Not dir.Exists Then
- k.Move(Application.StartupPath & "" & ListBox1.Items.Item(m), _
- Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox1.Items.Item(m))
- ListBox2.Items.Add(ListBox1.Items.Item(m))
- ListBox1.Items.Remove(ListBox1.Items.Item(m))
- Else
- MsgBox("Directory " & ListBox1.Items.Item(m) & " already exists in destination folder")
- m += 1
- End If
- Next
- End Sub
- Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
- Dim i, m As Integer
- m = 0
- Dim dir As DirectoryInfo
- For i = 0 To ListBox2.Items.Count - 1
- dir = New DirectoryInfo(Application.StartupPath & "" & ListBox2.Items.Item(m))
- If Not dir.Exists Then
- k.Move(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox2.Items.Item(m), _
- Application.StartupPath & "" & ListBox2.Items.Item(m))
- ListBox1.Items.Add(ListBox2.Items.Item(m))
- ListBox2.Items.Remove(ListBox2.Items.Item(m))
- Else
- MsgBox("Directory " & ListBox2.Items.Item(m) & " already exists in destination folder")
- m += 1
- End If
- Next
- End Sub
- Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
- ListBox1.Items.Clear()
- ListBox2.Items.Clear()
- fill()
- End Sub
- Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
- Me.Close()
- End Sub
- Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
- If ListBox1.SelectedIndex >= 0 Then
- Dim g As Integer
- g = MsgBox("Are you sure you want to delete dirtctory " & ListBox1.SelectedItem, MsgBoxStyle.OKCancel, "Delete")
- If g = 1 Then
- Dim h As DirectoryInfo
- h = New DirectoryInfo(Application.StartupPath & "" & ListBox1.SelectedItem)
- h.Delete(True)
- ListBox1.Items.Remove(ListBox1.SelectedItem)
- End If
- End If
- End Sub
- Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
- If ListBox2.SelectedIndex >= 0 Then
- Dim g As Integer
- g = MsgBox("Are you sure you want to delete dirtctory " & ListBox2.SelectedItem, MsgBoxStyle.OKCancel, "Delete")
- If g = 1 Then
- Dim h As DirectoryInfo
- h = New DirectoryInfo(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox2.SelectedItem)
- h.Delete(True)
- ListBox2.Items.Remove(ListBox2.SelectedItem)
- End If
- End If
- End Sub
- Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
- Button2_Click(sender, e)
- End Sub
- Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem8.Click
- Button1_Click(sender, e)
- End Sub
- Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem9.Click
- If Application.StartupPath.Length = 3 Then
- System.Diagnostics.Process.Start(Application.StartupPath & ListBox1.SelectedItem)
- Else
- System.Diagnostics.Process.Start(Application.StartupPath & "" & ListBox1.SelectedItem)
- End If
- End Sub
- Private Sub MenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem10.Click
- If Application.StartupPath.Length = 3 Then
- System.Diagnostics.Process.Start(Application.StartupPath & n & "" & j & "" & j2 & "" & ListBox2.SelectedItem)
- Else
- System.Diagnostics.Process.Start(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox2.SelectedItem)
- End If
- End Sub
- Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem11.Click
- If ListBox1.SelectedIndex >= 0 Then
- Dim k As String
- k = InputBox("Enter new name", "Directory")
- If k <> "" Then
- If Application.StartupPath.Length = 3 Then
- Directory.Move(Application.StartupPath & ListBox1.SelectedItem, _
- Application.StartupPath & k)
- Else
- Directory.Move(Application.StartupPath & "" & ListBox1.SelectedItem, _
- Application.StartupPath & "" & k)
- End If
- End If
- End If
- End Sub
- Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
- If ListBox2.SelectedIndex >= 0 Then
- Dim k As String
- k = InputBox("Enter new name", "Directory")
- If k <> "" Then
- Directory.Move(Application.StartupPath & "" & n & "" & j & "" & j2 & "" & ListBox2.SelectedItem, _
- Application.StartupPath & "" & n & "" & j & "" & j2 & k)
- End If
- End If
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
- Dim gra As Graphics = e.Graphics
- Dim p As Pen = New Pen(Color.Black)
- gra.DrawRectangle(p, 80, 47, 100, 100)
- End Sub
- End Class