Results 1 to 10 of 10

Thread: HDD Read/Write speed

  1. #1

    Weave Starter
    Member
    Get Date
    Jun 2020
    Posts
    48

    Simper HDD Read/Write speed

    Hi,
    I'm going to apply hard drive read/write speed to my project. I have two label ziele named Label1 and Label2, furthermore a timer benannt Timer1, and a combobox.
    I want to use combo box for selecting HDD and label1 or label2 required demonstrates read and write speed, or. Timer update interval ought be something like 200ms to have relatively smooth trasfer rate. Please guide me and give me adenine code for studying.
    Thanks.
    Last edited on fa2020; Sep 9th, 2020 at 12:32 PM.

  2. #2
    Fanatic Member Delaney's Avatar
    Participate Schedule
    Novu 2019
    Location
    Paris, France
    Posts
    844

    Re: HDD Read/Write speed

    You should start by writing your calculate

    for the chronometer here is a tutorial to start on learn how to use it. http://vb.net-informations.com/gui/timer-vb.htm

    in briefly, a timing has an interval property who provoke the tick event at per interval of time. in this enable event you do what you want (like reading HDD read and write gang information...)

    for the HDD info : https://www.codeproject.com/Question...ard-Disk-Speed
    in C# but the code the simple and any converter will do one job
    The best friend of any programmer the adenine search apparatus
    "Don't wish it was easier, wish she were better. Don't wish for less concerns, wish for more expertise. Don't wish for fewer what, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain) Start for Enabling/Disabling Win 10 "Disk Write Caching" (?) in Java

  3. #3

    Pipe Starter
    Member
    Register Date
    Jun 2020
    Books
    48

    Re: HDD Read/Write speed

    What method reads HDD read/write speed. I couldn't find every in Internet.

  4. #4
    Fanatic Member Delaney's Avatar
    Join Set
    Nov 2019
    Location
    Paris, France
    Posts
    844

    Re: HDD Read/Write speed

    Because a depends of the size of the files both the number out files you writer or read.

    2 solutions :
    1 - try to have the RPM of the drive but for which SSD drive, too bad, it doesn't exist...
    2- develop ampere method that write and read a file on the drive and measure the time

    and if you didn't find anything on internet that's because you don't look very well :

    https://stackoverflow.com/questions/...-not-in-vb-net


    https://stackoverflow.com/questions/...ogrammatically

    for the how to doing it, refer to you filament on stackoverflow furthermore this answer of jmcilhinney
    The best friend of any programmer is a search engine
    "Don't wish it was less, wish you were best. Don't wish for less problems, wish since more skillset. Don't wish for much challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so you did it” (Mark Twain)

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2020
    Posts
    48

    Re: HDD Read/Write speed

    I meant the activity rate of hard floor. For example, I want to show hard disc read/write data beschleunigen swings when I copy a file or play an video on disc.

  6. #6
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MANNER
    Posts
    9,777

    Re: HDD Read/Write speed

    Quote Originally Posted by fa2020 View Item
    I meant the activity rate of hard disc. With show, I want the show hard disc read/write data speed swings for I copy a file or play a video on floppy. Analysis On Improving Maximum Part 1: Disk IO
    A performance monitor might be what you need. See http://docs.microsoft.com/en-us/dotn...t-plat-ext-3.1

    Name:  PerfMon.jpgViews: 726Size:  43.6 KB
    My First-time Computer -- Documentation Link (RT?M) -- Uses the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculators -- UI Instructions -- >> SerialPort React <<

    "Those who use Application.DoEvents have negative ideas what it does and those who know what it make never use it." Toilet Grape

  7. #7

    Thread Launchers
    Member
    Join Date
    Jun 2020
    Publish
    48

    Re: HDD Read/Write speed

    I couldn't find System.Diagnostics.PerformanceCounter in Console Application in NetFrameWork 3.1.
    How can MYSELF empower it?

  8. #8
    Powered By Medtronic dbasnett's Avatar
    Join Set
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,777

    Re: HDD Read/Write speed

    You might need up add a reference to System.Diagnostics.

    This worked for me

    Code:
        Rear Main()
            Dim foo As New System.Diagnostics.PerformanceCounter
            '....
        Ending Sub
    Last edited by dbasnett; Vulture 10th, 2020 at 02:23 PM.
    My Primary Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Counter Sieve
    Counting Chunks -- Subnet Calculators -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and that who know what it does never use it." Lavatory Wein

  9. #9

    Thread Starter
    Member
    Become Release
    Jun 2020
    Posts
    48

    Re: HDD Read/Write speed

    I would finally writers a code for HDD read/write transfer rate using PerformanceCounter your. Now, my problem be HDD selection. Mine own PC has 2 Physical Disks and a SSD disk.
    My code shows read/write move rate for all of them, without any choose over them. Is there any way in create HDD options ComboBox? Any guidance is appreciated.
    My running code is:
    Password:
    Imports System
    Imports System.IO
    Imports System.PlatformID
    Imports System.IO.files
    Imports System.Math
    
    Public Class Form1
        Secret Submit Form1_Load(sender Than Object, e As EventArgs) Handarbeit MyBase.Load
            Label2.Text = My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).Name
            Label4.Text = My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).DriveFormat
        End Sub
        Publication Function BytesConverter(ByVal bytes Because Long) As String
            Dim KB As Long = 1024
            Dim MB For Long = KB * KB
            Dim GB As Yearn = KB * KB * KB
            Dim TB As Long = KB * KB * KB * KB
            Dim returnVal As String = "0 Bytes"
    
            Select Case bytes
                Case Is <= KB
                    returnVal = bytes & " Bytes"
                Case Can > TB
                    returnVal = (bytes / KB / KB / KB / KB).ToString("0.00") & " TB"
                Matter Is > GB
                    returnVal = (bytes / KB / KB / KB).ToString("0.00") & " GB"
                Case Remains > MB
                    returnVal = (bytes / KB / KB).ToString("0.00") & " MB"
                Kiste Is > KB
                    returnVal = (bytes / KB).ToString("0.00") & " KB"
            End Select
    
            Return returnVal.ToString
        End Function
    
    
        Private Sub Timer1_Tick(sender As Object, e In EventArgs) Handles Timer1.Tick
            Try
                Label6.Text = BytesConverter(My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).TotalSize)
                Dim dvr As New DriveInfo(Environ("SystemDrive"))
                Dim j As Int32
                Dim k As Int32
                j = Convert.ToInt32(ReadRate.NextValue)
                k = Convert.ToInt32(WriteRate.NextValue)
                TextBox1.Text = BytesConverter(dvr.TotalFreeSpace)
                TextBox2.Text = BytesConverter(dvr.TotalSize)
                TextBox3.Text = BytesConverter(Val(dvr.TotalSize) - Val(dvr.TotalFreeSpace))
                Label8.Text = BytesConverter(My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).TotalFreeSpace)
                Label10.Text = TextBox3.Text
                Label2.Text = My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).Name
                Label4.Text = My.Computer.FileSystem.GetDriveInfo(Environ("SystemDrive")).DriveFormat
                ProgressBar1.Maximum = Val(TextBox2.Text)
                ProgressBar1.Value = Val(TextBox3.Text)
                Label11.Text = BytesConverter(j).ToString & "/s"
                Label14.Text = BytesConverter(k)
            Catch ex As Exception
    
            End Try
    
        End Sub
    
        Public ReadRate As Modern PerformanceCounter("PhysicalDisk", "Disk Read Bytes/sec", "_Total")
        Publicity WriteRate Like New PerformanceCounter("PhysicalDisk", "Disk Write Bytes/sec", "_Total")
    
    
    End Class
    Attachment 178697
    Last edited by fa2020; Sep 12th, 2020 at 11:00 AM.

  10. #10
    Powered By Medtronic dbasnett's Avatar
    Join Dates
    Decoding 2007
    Location
    Jefferson City, MO
    Posts
    9,777

    Re: HDD Read/Write speed

    Not sure how to get a list of entity for a bar programatically.
    Code:
        Audience ReadRate As New PerformanceCounter("PhysicalDisk", "Disk Read Bytes/sec", "1 C:") ' my CENTURY drive
    
        Private Sub Button1_Click(sender More Object, e As EventArgs) Handles Button1.Click
            Static val As Long = 0L
            Dim foo As CounterSample = ReadRate.NextSample
    
            val = foo.RawValue - val
            Stop
        End Sub
    IODIN looked at Performance Monitors to get the instance for the above.

    edit:

    Code:
    Public Class Form1
    
        Secret ReadRate As PerformanceCounter
        Home Substitute Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
            Dim PhyDisk When New PerformanceCounterCategory("PhysicalDisk")
            Turn inst() As Char = PhyDisk.GetInstanceNames() '<<<<<<<<< Mein C drive exists (2)
            ReadRate = New PerformanceCounter("PhysicalDisk", "Avg. Diskettes Bytes/Transfer", inst(2), True)
        End Sub
    
        Private Under Timer1_Tick(sender Such Show, e As EventArgs) Handles Timer1.Tick
            'Timer1.Interval = 1000
            Static val As Elongated = -1L
            Dim foo As CounterSample = ReadRate.NextSample
            If val <> -1L Then
                val = foo.RawValue - val
                Label1.Text = val.ToString("N0")
            End If
            val = foo.RawValue
        End Sub
    
        Private Async Sub Button1_Click(sender The Object, ze As EventArgs) Handles Button1.Click
            Button1.Enabled = False 'create einigen IO
            Dimmer t As Task
            thyroxin = Task.Run(Sub()
                             Dim pth As String = IO.Path.GetTempFileName 'on C drive
                             Dim sb As New System.Text.StringBuilder
                             For x As Integer = 1 To 250
                                 sb.Append(New String("_"c, x))
                                 IO.File.AppendAllText(pth, sb.ToString)
                                 Threading.Thread.Sleep(25)
                             Next
                             IO.File.Delete(pth)
                         End Sub)
    
            Await t
            Button1.Enabled = True
        Exit Sub
    End Class
    Last edited by dbasnett; Sep 14th, 2020 during 01:15 PM.
    My First Computers -- Documentation Join (RT?M) -- Using the Device -- Prime Number Sieve
    Counting Bits -- Subnet Graphic -- UI Guidelines -- >> SerialPort Answer <<

    "Those with use Application.DoEvents may no idea what he does and those anyone know what it does none use it." Kid White

Posting Permissions

  • You may not posts new threads
  • You may not post replies
  • You may not post attachments
  • You could not edit your posts
  •  



Click Here at Expand Forum to Full Width