Tuesday, October 26, 2010

A day of surfing the web

Today, I thinking of making a program using visual basic 2008 that able to show computer status like CPU usage, ram usage, temperature, hard disk and etc...

In temperature part, I faced some problems. 


Dim searcher As New ManagementObjectSearcher("root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature")
For Each queryObj As ManagementObject In searcher.Get
Dim temperature As String = CObj(queryObj("CurrentTemperature"))
temperature = (temperature - 2732) / 10.0
MsgBox("CPU TEMPERATURE:" & temperature.ToString)
Next

The problem that I faced is when I try to get the CPU temperature, I getting lesser than how it should be. I getting only 42 and 38 for my core 2 duo processor but my actual temperature from Notebook Hardware Control 2.0 is around 69 for both processors. 

May be there is solution for this problem. I hope for those who knows how to solve this problem, please guide me. I had been surfing the web for this problem the whole day and still can't get the solution. 

For those who want to have more tutorials on Visual Basic 2008, my another blog is actually actively providing the tutorials. 

Click here to go to the tutorials.

  


Tuesday, October 19, 2010

Visual Basic -Bit Converter

Having problems in your partitioning of hard disk? Can't get the exact 50 GB on C drive? Wondering why does it happens? Here is a solution for it. 

Usually in partitioning, the unit that required is in MB. But for your information, 50000 MB ≠ 50 GB but lesser than 50 GB. That is why you cannot get exact 50 GB on your C drive. 

To Solve the problem, I had created a application that will help you to convert from bit/bytes/kilobits/kilobytes/megabits/megabytes/gigabits/gigabytes/terabytes/petabytes to each other. 

For example, if you want 50 GB on C drive, you can choose gigabytes from the combobox.


As you can see from the picture above, 50 GB is equal to 51200 MB. So you will need to insert 51200 MB in order to have exact 50 GB.

For those who like this application, there is a video on youtube:

http://www.youtube.com/watch?v=uBM0UhymIHM

And for those who want to download the application, the download link is the following:

http://programmingbeginner.zxq.net/



Monday, October 4, 2010

Visual Basic Tutorial - getting image from print screen

This is my first tutorial in this blog. For those who want to have a look at my other tutorials, please check my another blog at: http://tutorialoflife.blogspot.com/ and my website http://programmingbeginner.zxq.net/.




This application might be useful when you want save your print screen picture. Although in the video I didn't include the save function, I will include here. There will be also auto save function to save every picture that being print screen.




This is the print screen of the save and auto save function that added to the form. Savefiledialog1 and folderbrowserdialog1 are added. 

The coding will be provided in the following:

Code:

Public Class Form1 Dim temp As Object Dim i As Integer Private Sub HideToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HideToolStripMenuItem.Click Me.Hide() My.Computer.Clipboard.Clear() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If My.Computer.Clipboard.ContainsImage = True Then PictureBox1.Image = My.Computer.Clipboard.GetImage My.Computer.Clipboard.Clear() Me.Show() If AutoSaveToolStripMenuItem.Checked = True Then Try PictureBox1.Image.Save(temp & "\" & i & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg) i = i + 1 Catch ex As Exception End Try End If End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() i = 1 End Sub Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click SaveFileDialog1.Filter = "Jpeg (*.jpg)|*.jpg" SaveFileDialog1.ShowDialog() If SaveFileDialog1.FileName <> "" Then PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg) End If End Sub Private Sub AutoSaveToolStripMenuItem_CheckStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles AutoSaveToolStripMenuItem.CheckStateChanged If AutoSaveToolStripMenuItem.Checked = True Then FolderBrowserDialog1.ShowDialog() FolderBrowserDialog1.Description = "Selected path to save your picture." temp = FolderBrowserDialog1.SelectedPath End If End SubEnd Class

For those who want the application, please go to my website for download.

http://programmingbeginner.zxq.net/.

It will be uploaded soon. 



 

Sunday, October 3, 2010

A new start

This is blog that will start in learning and trying to teach others programming. For now, I had learn html and css from http://www.w3schools.com. Thanks to w3schools which guide me a lot in programming. 

I had also learn from youtube some tutorials on visual basic 2008 and I had uploaded some videos on applications that I created. I had created two blogs. This is one of it and another one is:

 http://tutorialoflife.blogspot.com/

Besides that, I am trying to host a free website with free web hosting service provided by http://www.zymic.com/.

The link is :

http://programmingbeginner.zxq.net/

This website is still under modification but anyone can visit it and give comment and suggestion to me on the modification.

 Thanks.