GetVolumeSerial

hello,
I would like to create a button so that when you click it you see
this MessageBox.Show(GetVolumeSerialNumber("C:\"))
how can I do that ?
apleloisAsked:
Who is Participating?
 
sk33v3Commented:
I believe this is what you are looking for.

http://addressof.com/blog/archive/2004/02/14/392.aspx
0
 
ElrondCTCommented:
Do you mean you want a MessageBox to display when you click a button, or you want the text on the button itself to have the results of your function?  In either case, you'd put the code in the button's Click event, such as:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MessageBox.Show(GetVolumeSerialNumber("C:\"))
    End Sub

or

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Text = GetVolumeSerialNumber("C:\")
    End Sub

The click event subroutine is the one created when you double-click a button that's on the design surface of a form.
0
 
apleloisAuthor Commented:
Error      1      Name 'GetVolumeSerialNumber' is not declared.
0
 
ElrondCTCommented:
Perhaps I misunderstood. I thought from this and your other message that you already had the function created to get a volume serial number. If you don't have that function, then sk33v3's link is what you need; download the code from there. If you have the function in your program, and you're getting the error above, then I think you need to explain a bit more what's going on (show us the code where you're getting the error).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.