创建具有权限的网络共享

发布于 2024-12-05 02:31:51 字数 113 浏览 2 评论 0原文

我在 inet 上没有找到任何关于如何创建网络共享并为本地组设置权限的好信息或库。我正在使用 c# 和 Windows Server 2008。

是否有人有一些好的资源或示例来为我指明正确的方向?

I didn't find any good info or library on the inet, about how to create a network share and set permission for a local group. I'm using c# and Windows Server 2008.

Does anyone have some good resources or sample to point me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆那么伤 2024-12-12 02:31:51

您可以使用 Pinvoke 或 WMI,

Code Project 上有一篇关于此的非常好的文章:如何使用.NET框架创建文件共享

整个事情的关键是以下Windows API:

[DllImport("Netapi32.dll")]
public static extern int NetShareAdd([MarshalAs(UnmanagedType.LPWStr)]
string strServer, Int32 dwLevel, IntPtr buf, IntPtr parm_err);

对于使用WMI,MSDN“知道”:创建 Win32_Share 类的方法

You can use Pinvoke or WMI,

there is a very nice article on this on Code Project: How to create a file share using .NET framework

the key of the whole thing is the following Windows API:

[DllImport("Netapi32.dll")]
public static extern int NetShareAdd([MarshalAs(UnmanagedType.LPWStr)]
string strServer, Int32 dwLevel, IntPtr buf, IntPtr parm_err);

for using WMI, MSDN "knows": Create method of the Win32_Share Class

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文