C# 如何在c中获取连接到共享文件夹中会话的用户列表#

C# 如何在c中获取连接到共享文件夹中会话的用户列表#,c#,.net,C#,.net,如何检索连接到共享文件夹会话的详细信息 计算机管理->共享文件夹->会话 我已尝试使用ManagementScope类检索共享文件夹详细信息,但无法获取连接到共享文件夹的会话列表 我无法获取网络计算机中存在的会话的详细信息您可以使用命令“Icacls.exe”获取正在访问文件夹的用户列表。在C#中,您可以这样做: // Start a process and with the folder path as parameter string folder = @"N:\Documents\File

如何检索连接到共享文件夹会话的详细信息

计算机管理->共享文件夹->会话

我已尝试使用ManagementScope类检索共享文件夹详细信息,但无法获取连接到共享文件夹的会话列表

我无法获取网络计算机中存在的会话的详细信息

您可以使用命令“Icacls.exe”获取正在访问文件夹的用户列表。在C#中,您可以这样做:

// Start a process and with the folder path as parameter
string folder = @"N:\Documents\Files\folderName";
ProcessStartInfo oInfo = new ProcessStartInfo();
oInfo.FileName = "Icacls.exe";
oInfo.Arguments = folder;
oInfo.RedirectStandardOutput = true;
oInfo.UseShellExecute = false;
Process oProcess = new Process();
oProcess.StartInfo = oInfo;
oProcess.Start();

// Redirect the result in a string
string result = oProcess.StandardOutput.ReadToEnd();
Console.WriteLine(result);        
Console.Read();

// Do some stuff with the string

你实际使用了什么代码?我复制了你的标题,粘贴到谷歌上,找到了^你能告诉我你找到了什么吗?提供的枚举网络会话链接对远程计算机不起作用。错误在53-BADNETPATH中返回