当前位置: 首页>>代码示例>>Java>>正文


Java MsrpcShareEnum类代码示例

本文整理汇总了Java中jcifs.dcerpc.msrpc.MsrpcShareEnum的典型用法代码示例。如果您正苦于以下问题:Java MsrpcShareEnum类的具体用法?Java MsrpcShareEnum怎么用?Java MsrpcShareEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MsrpcShareEnum类属于jcifs.dcerpc.msrpc包,在下文中一共展示了MsrpcShareEnum类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doMsrpcShareEnum

import jcifs.dcerpc.msrpc.MsrpcShareEnum; //导入依赖的package包/类
static FileEntry[] doMsrpcShareEnum ( CIFSContext ctx, String host, Address address ) throws IOException {
    MsrpcShareEnum rpc = new MsrpcShareEnum(host);
    /*
     * JCIFS will build a composite list of shares if the target host has
     * multiple IP addresses such as when domain-based DFS is in play. Because
     * of this, to ensure that we query each IP individually without re-resolving
     * the hostname and getting a different IP, we must use the current addresses
     * IP rather than just url.getHost() like we were using prior to 1.2.16.
     */
    try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + address.getHostAddress() + "[\\PIPE\\srvsvc]", ctx) ) {
        handle.sendrecv(rpc);
        if ( rpc.retval != 0 )
            throw new SmbException(rpc.retval, true);
        return rpc.getEntries();
    }
}
 
开发者ID:AgNO3,项目名称:jcifs-ng,代码行数:17,代码来源:SmbEnumerationUtil.java

示例2: testSRVS

import jcifs.dcerpc.msrpc.MsrpcShareEnum; //导入依赖的package包/类
@Test
public void testSRVS () throws DcerpcException, IOException {
    try ( DcerpcHandle handle = DcerpcHandle
            .getHandle("ncacn_np:" + getTestServer() + "[\\PIPE\\srvsvc]", withTestNTLMCredentials(getContext())) ) {
        MsrpcShareEnum rpc = new MsrpcShareEnum(handle.getServerWithDfs());
        handle.sendrecv(rpc);
        assertEquals(0, rpc.retval);
    }
}
 
开发者ID:AgNO3,项目名称:jcifs-ng,代码行数:10,代码来源:PipeTest.java

示例3: exclusiveConnection

import jcifs.dcerpc.msrpc.MsrpcShareEnum; //导入依赖的package包/类
@Test
public void exclusiveConnection () throws IOException {
    try ( DcerpcHandle handle = DcerpcHandle
            .getHandle("ncacn_np:" + getTestServer() + "[\\PIPE\\srvsvc]", withTestNTLMCredentials(getContext()), true) ) {
        MsrpcShareEnum rpc = new MsrpcShareEnum(handle.getServerWithDfs());
        handle.sendrecv(rpc);
        assertEquals(0, rpc.retval);
    }
}
 
开发者ID:AgNO3,项目名称:jcifs-ng,代码行数:10,代码来源:PipeTest.java


注:本文中的jcifs.dcerpc.msrpc.MsrpcShareEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。