How to code DriveInfo class
-
I am using VS.NET 2003. I want to use the DriveInfo class to get the volume label of the logical drives on my PC. According to Microsoft doc the DriveInfo class is part of the System::IO namespace (see "http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx"). But the declaraion "DriveInfo* myDriveInfo" produces a compile error. The compiler does not know about the DriveInfo class. Does any one know what I have done wrong?? Eg. it knows about "System::IO::Directory" but not "System::IO::DriveInfo" dragon_n
-
I am using VS.NET 2003. I want to use the DriveInfo class to get the volume label of the logical drives on my PC. According to Microsoft doc the DriveInfo class is part of the System::IO namespace (see "http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.aspx"). But the declaraion "DriveInfo* myDriveInfo" produces a compile error. The compiler does not know about the DriveInfo class. Does any one know what I have done wrong?? Eg. it knows about "System::IO::Directory" but not "System::IO::DriveInfo" dragon_n
This is a .Net 2.0 class. So you cant use it in VS2003. It works fine in VS2005 cheers...MIlton Kb
-
This is a .Net 2.0 class. So you cant use it in VS2003. It works fine in VS2005 cheers...MIlton Kb
Thanks Milton. So do you know how I can get logical drive info such as drive label? I have seen examples using GetVolumeInformation function (in VB) that uses types such as DWORD & UINT which I am not familiar with and don't know how to translate into C++.NET
-
Thanks Milton. So do you know how I can get logical drive info such as drive label? I have seen examples using GetVolumeInformation function (in VB) that uses types such as DWORD & UINT which I am not familiar with and don't know how to translate into C++.NET
Why cant u write the application in C++/Cli VS2005? It supports this driveinfo. cheers..milton.
-
Why cant u write the application in C++/Cli VS2005? It supports this driveinfo. cheers..milton.
I am using VS2003. I don't have VS2005. I am rewriting in VB.Net now so I can use "GetVolumeInformation". You know VB?? I am hitting another brickwall in VB. One of the parameters used by "GetVolumeInformation" is declared as Dim driveLabel As String = Space(200) This string has length of 200 (driveLabel.length = 200)even if the useful part of the string is only 5 chars long (say "Tommy ... " ) Do you know how I can extract the useful part of "driveLabel" in VB?? I might ask this question on the VB MessageBoard