Jump to content

[VB2008] Memory Info (With Progress Bars)

- - - - -

  • Please log in to reply
2 replies to this topic

#1
CuzImAwesome

CuzImAwesome

    Newbie

  • Members
  • PipPip
  • 25 posts
Hey! In this tutorial, we are going to make a program that outputs your virtual and physical memory, but in "progressbar form".

:c-^_^:

First off, add 2 labels, 1 timer, and 2 progress bars. Make sure that progressbar1 is on top. Then change the 2 labels to "Physical:" and "Virtual:".

It Should Look Like This:
Posted Image



Now we begin coding. Double click on the form and insert the following code:


Timer1.start



Then double click on the timer and insert this code:

Dim total1 As String = My.Computer.Info.TotalPhysicalMemory

Dim avail1 As String = My.Computer.Info.AvailablePhysicalMemory

Dim total2 As String = My.Computer.Info.TotalVirtualMemory

Dim avail2 As String = My.Computer.Info.AvailableVirtualMemory

Dim final1 As String = avail1 / total1

Dim final2 As String = avail2 / total2

ProgressBar1.Increment(0)

ProgressBar1.Value = avail1 / total1

ProgressBar2.Increment(0)

ProgressBar2.Value = avail2 / total2


And there ya go! Hoped this helped! :P

#2
Demon

Demon

    Newbie

  • Members
  • PipPip
  • 18 posts
Looks interesting, thanks for contributing. ^.^

#3
inswins

inswins

    Newbie

  • Members
  • Pip
  • 1 posts
I hope i can see the image again. By the way, thank for the code. I can use this for my assignment.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users