本文整理汇总了C#中Smb2FunctionalClient.SetSecurityDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C# Smb2FunctionalClient.SetSecurityDescriptor方法的具体用法?C# Smb2FunctionalClient.SetSecurityDescriptor怎么用?C# Smb2FunctionalClient.SetSecurityDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smb2FunctionalClient
的用法示例。
在下文中一共展示了Smb2FunctionalClient.SetSecurityDescriptor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSecurityDescriptor
protected void SetSecurityDescriptor(string sharePath, string fileName, _SECURITY_DESCRIPTOR sd, SET_INFO_Request_AdditionalInformation_Values securityAttributesToApply)
{
Smb2FunctionalClient clientAdmin;
clientAdmin = new Smb2FunctionalClient(TestConfig.Timeout, TestConfig, BaseTestSite);
clientAdmin.ConnectToServer(TestConfig.UnderlyingTransport, TestConfig.SutComputerName, TestConfig.SutIPAddress);
uint treeId;
ConnectToShare(clientAdmin, TestConfig.AccountCredential, sharePath, out treeId);
FILEID fileId;
Smb2CreateContextResponse[] createContextResponses;
clientAdmin.Create(treeId,
fileName,
fileName == null ? CreateOptions_Values.FILE_DIRECTORY_FILE : CreateOptions_Values.FILE_NON_DIRECTORY_FILE,
out fileId,
out createContextResponses,
accessMask: AccessMask.READ_CONTROL | AccessMask.WRITE_DAC | AccessMask.FILE_READ_ATTRIBUTES | AccessMask.WRITE_OWNER | AccessMask.ACCESS_SYSTEM_SECURITY,
shareAccess: ShareAccess_Values.FILE_SHARE_DELETE | ShareAccess_Values.FILE_SHARE_READ | ShareAccess_Values.FILE_SHARE_WRITE,
createDisposition: CreateDisposition_Values.FILE_OPEN);
clientAdmin.SetSecurityDescriptor(treeId, fileId, securityAttributesToApply, sd);
clientAdmin.Close(treeId, fileId);
clientAdmin.TreeDisconnect(treeId);
clientAdmin.Disconnect();
}