1
我想知道是否有可能限制遠程機器訪問服務器中的命名管道。 我正在對服務器進行初始化如下:是否可以限制遠程機器連接到NamedPipeServerStream?
NamedPipeServerStream pipeServer = new NamedPipeServerStream("myPipe", PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
遠程客戶端的作用:
using (NamedPipeClientStream pipeStream = new NamedPipeClientStream(serverIP, "myPipe", PipeDirection.InOut))
{
pipeStream.Connect(2000);
}
,當然它成功。 有沒有辦法限制它? 謝謝!
首先:您似乎在代碼示例的第3行中有複製粘貼錯誤。 'm_AccessRule'沒有用在代碼中,可能應該是'AccessRule'。除此之外,這給了我一個關於將訪問規則添加到「PipeSecurity」對象的'IdentityNotMappedException'。這表明'NT AUTHORITY \ NETWORK'用戶在我的系統中不存在,但這是不可能的,是嗎? – aRestless
@aRestless修復它。它怎麼可能不存在於你的系統中?當您嘗試共享文件夾時,請在文本框中輸入「網絡服務」,但它找不到它? – ArielB
如果我們正在討論這個對話:http://puu.sh/iFLJe/1d394791a6.png(德文文本雖然)不,它沒有找到它。更加好奇的是,如果我將'AccessRule'離開,我可以遠程連接到管道,但是我需要(你的)'AccessRule2'來使管道可以被訪問。看起來像「AccessRule2」允許更多的東西比它應該。 – aRestless