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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top