It is also a disk quota, but it is ASP, but it seems to be simple.

zhaozj2021-02-16  50

ASP:

<% disk = request.QueryString ("Disk" User = request.QueryString ("User") if disk = "" or user = "" "theRESPONSE.WRITE" does not specify a hard disk or user (disk, user) "ELSE

Set colDiskQuotas = CreateObject ( "Microsoft.DiskQuota.1") colDiskQuotas.Initialize disk, Trueset objUser = colDiskQuotas.FindUser (user) Response.write "warning level:" Response.write objUser.QuotaThresholdResponse.write "

quota restrictions: "Response.write objuser.quotalimit response.write

Quantity:" response.write objuser.quotausedResponse.write

Status: "Response.write Coldisk QUOTAS.QUOTASTATE

END IF%>

ASP.NET:

<% @ Page language = "c #" aspcompat = "true" AutoEventWireup = "false"%> <% @ Page language = "c #" aspcompat = "true" AutoEventWireup = "false"%> <% @ Import Namespace = "DiskQuotaTypeLibrary "%>

<% String disk = request.params ("disk"); stirng user = request.params ("user"); if (disk == null || user == null) {response.wirte ("No input disk or user DISK, User. "); Return;}

try {DiskQuotaControlClass diskQuotaControl = new DiskQuotaControlClass (); // Initializes the control to the specified path diskQuotaControl.Initialize ( "f: //", true); DIDiskQuotaUser dskuser = diskQuotaControl.FindUser ( "staff"); Response.Write ( " Disk quota: " DSKUSER.QUOTALIMITTEXT "
"); response.write (" Warning capacity: " DSKUSER.QUOTATHRESHOLDTEXT "
"); response.write (" Used capacity: " DSKUser. QuotausedText "
"); response.write ("Status:" DSKUSER.ACCountStatus "
"); response.write ("User Name: DSKUser.logonname);} catch {%> < % @ Import Namespace = "Diskquotatypelibrary"%> <% string disk = request.params ("disk"); stirng user = request.params ("user"); if (disk == null || user == null) { Response.Wirte ( "no name or user input disc (disk, user)."); return;} try {DiskQuotaControlClass diskQuotaControl = new DiskQuotaControlClass (); // Initializes the control to the specified path diskQuotaControl.Initialize ( "f: / / ", true); DIDiskQuotauser dskuser = Diskquotacontrol.Finduser (" staff "); response.write (" Disk quota: " DSKUSER.QUOTALIMITTEXT "" "; Response.write (" Warning Capacity: DSKUSER.QUOTATHRESHOLDTEXT "); Response.write (" Used capacity: DSKUSER.QUOTAUSEDTEXT ""); response.write ("status:" DSKUSER.ACCountStatus "" "; Response.write (" User Name: DSKUser.logonname);} Catch {%> <% @ Import Namespace = "DiskqueTypelibrary"%> <% string disk = request.params (" Disk "); stirng user =

转载请注明原文地址:https://www.9cbs.com/read-21669.html

New Post(0)