vbscript -> C#

  • Thread starter Thread starter Nicopilami
  • Start date Start date
N

Nicopilami

Hello
i try to do convert the following code into c# but i don't succeed
because the c# function DriveInfo do not seem to support UNC path...
am i wrong ?

' VB Script Document
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
totalSize=Int(fso.GetDrive("\\server\shared$").TotalSize)
freeSpace=Int(fso.GetDrive("\\server\shared$").FreeSpace)
usedSpace=totalSize-freeSpace
percentage=usedSpace/totalSize*100
MsgBox percentage


could you convert it for me ?
bye
Nico
 
Back
Top