Thank you so much,
SJ
"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sam,
>
> Just open project->add reference->and choose than system.management, and
> than select it and say ok.
>
> That is all.
>
> Cor
> "Sam Learner" <(E-Mail Removed)>
>
>> Thank you so much, I only one question, What file do I use to reference
>> the System.Management.* Namespace ?
>> I pasted your code in a project, but I got class undefined error.
>> Please help
>> Thanks,
>> SJ
>>
>> "Cor Ligthert" <(E-Mail Removed)> wrote in message
>> news:eLgwN%(E-Mail Removed)...
>>> Sam,
>>>
>>> Try this sample wich was original from Steve Hoag in this newsgroup,
>>> which I changed a little bit.
>>> \\\
>>> Public Module main
>>> Public Sub main()
>>> Dim LogicalDisk As _
>>> New System.Management.ManagementClass("Win32_LogicalDisk")
>>> Dim disks As System.Management.ManagementObjectCollection = _
>>> LogicalDisk.GetInstances()
>>> Dim disk As System.Management.ManagementObject
>>> For Each disk In disks
>>> If disk("Name").ToString = "C:" Then
>>> MessageBox.Show(disk("FreeSpace").ToString)
>>> End If
>>> Next disk
>>> End Sub
>>> End Module
>>> ///
>>>
>>> I hope this helps?
>>>
>>> Cor
>>>
>>> "Sam Learner" <(E-Mail Removed)>
>>>
>>>> Hi Everyone,
>>>> I thought in .NET there would be like a "Drive" class to allow obtain
>>>> specific information about Drives, but it looks like not.
>>>>
>>>> I need to scan a Drive and Obtain (Free and Used disk space)
>>>> information... similarly to what the CleanUP disk wizard does.
>>>> Can anyone help? may be some sample code, or a class?
>>>> thanks in advance,
>>>>
>>>> SJ
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
|