Skip to content

An advanced properties window made in VB.Net

License

Notifications You must be signed in to change notification settings

Walkman100/PropertiesDotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PropertiesDotNet Build status

An advanced properties window made in VB.Net

Gitter

Screenshots

PropertiesDotNet main window Hash generator window Folder deleting window Folder copying window File compress dialog

Download

Get the latest version here, and the latest build from commit here (note that these builds are built for the Debug config and so are not optimised)

If getting the latest build from commit, download PropertiesDotNet-Ookii.Dialogs.dll for full functionality.

Credits/Acknowledgements

Icons

Getting open with program

NTFS Compression

Hash Generating

Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.Security
Imports System.Security.Cryptography

Namespace NTFSCompress
    Public Partial Class MainForm
        Inherits Form
        Public Sub New()
            InitializeComponent()
        End Sub
        Private Sub BackgroundWorker_DoWork(sender As Object, e As DoWorkEventArgs)
            Dim buffer As Byte()
            Dim oldBuffer As Byte()
            Dim bytesRead As Integer
            Dim oldBytesRead As Integer
            Dim size As Long
            Dim totalBytesRead As Long = 0
            Using stream As Stream = File.OpenRead(DirectCast(e.Argument, String))
                Using hashAlgorithm As HashAlgorithm = MD5.Create()
                    size = stream.Length
                    buffer = New Byte(4095) {}
                    bytesRead = stream.Read(buffer, 0, buffer.Length)
                    totalBytesRead += bytesRead
                    Do
                        oldBytesRead = bytesRead
                        oldBuffer = buffer
                        buffer = New Byte(4095) {}
                        bytesRead = stream.Read(buffer, 0, buffer.Length)
                        totalBytesRead += bytesRead
                        If bytesRead = 0 Then
                            hashAlgorithm.TransformFinalBlock(oldBuffer, 0, oldBytesRead)
                        Else
                            hashAlgorithm.TransformBlock(oldBuffer, 0, oldBytesRead, oldBuffer, 0)
                        End If
                        BackgroundWorker.ReportProgress(CInt(Math.Truncate(CDbl(totalBytesRead) * 100 / size)))
                    Loop While bytesRead <> 0
                    e.Result = hashAlgorithm.Hash
                End Using
            End Using
        End Sub
    End Class
End Namespace

Compile requirements

See CompileInstructions.md