Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Available space on NAS
Message
De
20/02/2014 21:25:45
 
 
À
20/02/2014 16:20:30
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01594835
Message ID:
01594852
Vues:
40
>If you just want to make sure your application isn't going to run out of free space, then you really only care about the volume(s) to which you have been granted access. If these are mounted on your local computer as SMB/CIFS volumes, then they should respond to DOS, Win32 or .Net calls to get information about them. Googling I find http://msdn.microsoft.com/en-us/library/system.io.driveinfo%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1 . The .TotalSize, .TotalFreeSpace and (especially) .AvailableFreeSpace properties should give you what you need.

This is good if you have a map drive. Because, this requires a map letter. If you try to use \\NAS\ShareName, this will give:

"Object must be a root directory ("C:\") or a drive letter ("C")."

This is why I was not able to use that approach on the VM.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform