2016-08-11 5 views
-3

에 저장하는 방법 공유 폴더 세션에 연결된 세부 정보를 검색하는 방법.공유 폴더의 세션에 연결된 사용자 목록을 C :

컴퓨터 관리 -> 공유 폴더 -> 세션 ??

내가 ManagementScope 클래스를 사용하여 공유 폴더의 상세 정보를 검색하는 시도하지만, 공유 폴더에 연결 세션의 목록을 얻을 수 없습니다 ..

내가 네트워크에 존재하는 세션의 세부 사항을 얻을 수 없습니다입니다

컴퓨터

+0

실제로 어떤 코드를 시도 했습니까? – MethodMan

+2

나는 문자 그대로 문자를 복사하여 Google에 붙여 넣었고^ – FrankerZ

+0

찾았습니까? –

답변

0

"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 
+0

제공되는 네트워크 세션 열거 링크가 원격 컴퓨터에서 작동하지 않습니다. 53-BADNETPATH에서 오류가 반환됩니다. –

관련 문제