Son Çalışan Dosyalar

OnimoSReturnS

Yeni üye
7 Ağu 2010
50
0
Bu yayında bilgisayarınızda Son çalışan dosyaların listesini çıkartmaktadır.
56565.jpg


kaynak visualbasicdersleri.com


Kod:
Imports System.IO, System.Diagnostics, System.ComponentModel
'visualbasicdersleri.com
Public Class Form1
    Dim SonCalDsyKlasoru As String = Environment.GetFolderPath(Environment.SpecialFolder.Recent)
    Private Property eleman As ListViewItem
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        SCDsyGosterBtn.PerformClick()
    End Sub

    Private Sub SCDsyGosterBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SCDsyGosterBtn.Click
        ListView1.Items.Clear()

        Dim lstitem As New ListViewItem()
        imageList1.Images.Clear()
        For Each SonCalDsy In Directory.GetFiles(SonCalDsyKlasoru)
            Dim yol As String
            yol = Path.GetFileNameWithoutExtension(SonCalDsy)

            imageList1.Images.Add(SonCalDsy, Icon.ExtractAssociatedIcon(SonCalDsy)) 'Dosya adı ve ikonu
            lstitem = ListView1.Items.Add(Path.GetFileNameWithoutExtension(SonCalDsy), SonCalDsy)
            lstitem.SubItems.Add(New FileInfo(SonCalDsy).CreationTime.ToLongDateString()) 'Tarih ToLongDateString
            lstitem.SubItems.Add(SonCalDsy) 'yol ekle
        Next
    End Sub

    Private Sub ListView1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick
        Try
            Process.Start(TextBox1.Text)
            'visualbasicdersleri.com
        Catch m As Win32Exception
        End Try
    End Sub

    Private Sub openToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AcTSm.Click, DosyaAçTSmn.Click
        ListView1_DoubleClick(sender, e)
    End Sub

    Private Sub open********ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DsyKlsAcTsm.Click, DsyKlsAçTsmn.Click
        Process.Start(SonCalDsyKlasoru)
    End Sub


    Private Sub TumSilTsm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TumSilTsm.Click
        For Each TumCalDsy In Directory.GetFiles(SonCalDsyKlasoru)

            File.Delete(TumCalDsy)
        Next

        ListView1.Items.Clear() 'visualbasicdersleri.com
    End Sub

    Dim DosyaSil As String

    Private Sub SecilSilTsm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SecilSilTsm.Click
        For Each selected In ListView1.SelectedItems
            DosyaSil = selected.ToString.Remove(0, selected.ToString.IndexOf("{") + 1).Replace("}", "")
            File.Delete(DosyaSil)
            ListView1.Items.RemoveByKey(DosyaSil)
        Next
    End Sub

    Private Sub SilTsm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SilTsm.Click
        File.Delete(ListView1.SelectedItems(0).Text)
        ListView1.Items.RemoveByKey(ListView1.SelectedItems(0).Text)
    End Sub



    Private Sub ListView1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Right Then 'visualbasicdersleri.com
            If (ListView1.SelectedItems.Count > 0) Then
                'contextMenuStrip3.Show(ListView1, 0, -50)
                contextMenuStrip1.Show(ListView1, ListView1.SelectedItems(0).Position.X + 20, ListView1.SelectedItems(0).Position.Y + 20)
            End If
        End If
    End Sub

    Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
        Dim sayi As Integer = ListView1.Items.Count
        Dim eleman As ListViewItem
        For i As Integer = 0 To sayi - 1
            eleman = ListView1.Items(i)
            If eleman.Selected Then
                Label1.Text = ListView1.Items(i).SubItems(0).Text
                TextBox1.Text = ListView1.Items(i).SubItems(2).Text

            End If
        Next 'visualbasicdersleri.com
    End Sub

#Region " ESC İLE KAPATMA, DELETE İLE SATIR SİLME...."

    Private Sub ListView1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles ListView1.KeyDown
        If e.KeyCode = Keys.Delete Then
            Call ListedenSatırSil()
        End If
        If e.KeyCode = Keys.Escape Then
            Me.Close()
        End If
    End Sub

    Public Sub ListedenSatırSil()
        On Error Resume Next
        Dim indeksler As ListView.SelectedIndexCollection = ListView1.SelectedIndices
        Dim index As Integer

        TextBox1.Text = Nothing

        For Each index In indeksler
            ListView1.Items.RemoveAt(index)
        Next

        If index = 0 Then index = 0

        index = index - 1'visualbasicdersleri.com

        If index = -1 Then index = 0

        eleman = ListView1.Items(index)
        eleman.Selected = True
        ListView1.Focus()

    End Sub
#End Region

End Class
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.