我怎么能查询在C#中的NTFS磁盘配额? [英] How can I query NTFS disk quotas in C#?

查看:446
本文介绍了我怎么能查询在C#中的NTFS磁盘配额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够发现,对于给定的远程计算机,这些用户的磁盘配额和实际的磁盘使用情况上的所有用户。我需要能够做到这一点的报告在C#应用程序。 (嗯,技术上是一个DLL插件的应用程序,我已经建立。但是这无关紧要这里)

I need to be able to find, for all users on a given remote machine, those users' disk quotas and actual disk usage. I need to be able to do this reporting in a C# application. (Well, technically a DLL plugin for an app I've already built; but that's irrelevant here.)

  • 在远程机器是不一样的网络上,但是,在执行应用程序的应用程序能够提供的凭据。
  • 在WMI是完全可以接受的;我只是无法找到所需的确切咒语(现在找了3小时)。 (我也没有一个WMI亲;。如果你发布一个WMI的解决方案,请在必要的C#/。这架网 System.Management * 对象)
  • The remote machine is not on the same network, however, the application executing the app is able to supply the credentials.
  • WMI is perfectly acceptable; I just cannot find (after looking for over 3 hours now) the exact incantation needed. (I'm also not a WMI pro; if you post a WMI solution, please frame it in the requisite C#/.NET System.Management.* objects.)

推荐答案

该WMI类的 Win32_DiskQuota 编辑:的我发现了一个 VB.NET示例这可以帮助你。

The WMI class is Win32_DiskQuota. I found a VB.NET sample which may help you.

或者你可以尝试做到这一点使用的P / Invoke (链接进入到P / Invoke的维基,在那里你可能会发现一些签名)。 指针开始与配额如下$ C $的CProject文章: HTTP:/ /www.$c$cproject.com/KB/system/DiskQuota.aspx

Or you can try to do this using P/Invoke (link goes to the P/Invoke wiki, where you may find some of the signatures). A pointer to start with quotas is the following CodeProject article: http://www.codeproject.com/KB/system/DiskQuota.aspx

这篇关于我怎么能查询在C#中的NTFS磁盘配额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆