本文整理汇总了C#中Smb2FunctionalClient.QuerySecurityDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C# Smb2FunctionalClient.QuerySecurityDescriptor方法的具体用法?C# Smb2FunctionalClient.QuerySecurityDescriptor怎么用?C# Smb2FunctionalClient.QuerySecurityDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smb2FunctionalClient
的用法示例。
在下文中一共展示了Smb2FunctionalClient.QuerySecurityDescriptor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuerySecurityDescriptor
protected _SECURITY_DESCRIPTOR QuerySecurityDescriptor(string sharePath, string fileName, AdditionalInformation_Values securityAttributesToQuery)
{
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,
shareAccess: ShareAccess_Values.FILE_SHARE_DELETE | ShareAccess_Values.FILE_SHARE_READ | ShareAccess_Values.FILE_SHARE_WRITE,
createDisposition: CreateDisposition_Values.FILE_OPEN);
_SECURITY_DESCRIPTOR sd;
clientAdmin.QuerySecurityDescriptor(treeId, fileId, securityAttributesToQuery, out sd);
clientAdmin.Close(treeId, fileId);
clientAdmin.TreeDisconnect(treeId);
clientAdmin.LogOff();
clientAdmin.Disconnect();
return sd;
}