Hello, my dearest respected brother, All!
How do you make calls to Win32Api functions from C#
I have an old example in Visual FoxPro...
Kind of need to do the same in C# now...
I need to get volume information (as much as possible)
I am sure .Net Framework has already got something to
do with it, but I am also interested (in learning purposes)
how to do the same using Win32Api.
Here goes a part of Visual FoxPro example:
----------------------------------------------------------
lpRoot = "C:\"
lpVolName = SPACE(256)
nVolSize = 256
lpVolNumber = 0
lpMaxComp = 256
lpFlags = 0
lpFSName = SPACE(256)
nFSSize = 256
DECLARE INTEGER GetVolumeInformation ;
IN Win32API AS GetVolInfo ;
STRING @lpRoot, ;
STRING @lpVolName, ;
INTEGER nVolSize, ;
INTEGER @lpVolNumber, ;
INTEGER @lpMaxComp, ;
INTEGER @lpFlags, ;
STRING @lpFSName, ;
INTEGER nFSSize
lnRet=GetVolInfo(@lpRoot, @lpVolName, ;
nVolSize, @lpVolNumber, ;
@lpMaxComp, @lpFlags, ;
@lpFSName, nFSSize)
----------------------------------------------------------
Semicolons in FoxPro mean that the next line continues
a previous one.
Like each semicolon can be replaced with the next line.
'@' means a reference parameter.
And this is a working example (part of it). There are no errors...
Thanks in advance.
With best regards, Nurchi BECHED.