本文整理汇总了Java中org.jinterop.dcom.core.JIProgId类的典型用法代码示例。如果您正苦于以下问题:Java JIProgId类的具体用法?Java JIProgId怎么用?Java JIProgId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JIProgId类属于org.jinterop.dcom.core包,在下文中一共展示了JIProgId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public static void main ( final String[] args ) throws IllegalArgumentException, UnknownHostException, JIException
{
final TestConfiguration configuration = new MatrikonSimulationServerConfiguration ();
OPCServer server = null;
try
{
JISystem.setAutoRegisteration ( true );
_session = JISession.createSession ( args[1], args[2], args[3] );
//JIComServer comServer = new JIComServer ( JIClsid.valueOf ( configuration.getCLSID () ), args[0], _session );
final JIComServer comServer = new JIComServer ( JIProgId.valueOf ( configuration.getProgId () ), args[0], _session );
final IJIComObject serverObject = comServer.createInstance ();
server = new OPCServer ( serverObject );
final OPCGroupStateMgt group = server.addGroup ( "test", true, 100, 1234, 60, 0.0f, 1033 );
testItems ( server, group, configuration.getReadItems () );
server.removeGroup ( group, true );
}
catch ( final JIException e )
{
e.printStackTrace ();
showError ( server, e.getErrorCode () );
}
finally
{
if ( _session != null )
{
JISession.destroySession ( _session );
}
_session = null;
}
}
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:37,代码来源:Test2.java
示例2: MSSysInfo
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
MSSysInfo(String[] args) throws JIException, UnknownHostException
{
session = JISession.createSession(args[1],args[2],args[3]);
session.useSessionSecurity(true);
JIComServer comServer = new JIComServer(JIProgId.valueOf("SYSINFO.SysInfo"),args[0],session);
sysInfoServer = comServer.createInstance();
sysInfoObject = (IJIComObject)sysInfoServer.queryInterface("6FBA474C-43AC-11CE-9A0E-00AA0062BB4C");
dispatch = (IJIDispatch)JIObjectFactory.narrowObject(sysInfoObject.queryInterface(IJIDispatch.IID));
}
开发者ID:howie,项目名称:jinterop,代码行数:11,代码来源:MSSysInfo.java
示例3: main
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public static void main(String[] args) {
try {
if (args.length < 4)
{
System.out.println("Please provide address domain username password");
return;
}
JISystem.setInBuiltLogHandler(false);
JISystem.setAutoRegisteration(true);
for (int i=0;i<10000;++i)
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
JIComServer comServer = new JIComServer(JIProgId.valueOf("MSMQ.MSMQQueueInfo"),args[0],session);
IJIComObject unknown = comServer.createInstance();
IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject(unknown.queryInterface(IJIDispatch.IID));
//JISession.destroySession(session);
Thread.sleep(150);
if(i%100 == 0)
{
System.out.println(new String().valueOf(i));
}
System.gc();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:howie,项目名称:jinterop,代码行数:33,代码来源:Test10KServer.java
示例4: MSEnumVariant
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSEnumVariant(String address,String[] args) throws JIException, UnknownHostException
{
session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("StdCollection.VBCollection"),address,session);
IJIComObject object = comServer.createInstance();
dispatch = (IJIDispatch)JIObjectFactory.narrowObject(object.queryInterface(IJIDispatch.IID));
}
开发者ID:howie,项目名称:jinterop,代码行数:9,代码来源:MSEnumVariant.java
示例5: MSWMI
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSWMI(String address, String[] args) throws JIException, UnknownHostException
{
this.address = address;
session = JISession.createSession(args[1],args[2],args[3]);
session.useSessionSecurity(true);
session.setGlobalSocketTimeout(5000);
comStub = new JIComServer(JIProgId.valueOf("WbemScripting.SWbemLocator"),address,session);
IJIComObject unknown = comStub.createInstance();
comObject = (IJIComObject)unknown.queryInterface("76A6415B-CB41-11d1-8B02-00600806D9B6");//ISWbemLocator
//This will obtain the dispatch interface
dispatch = (IJIDispatch)JIObjectFactory.narrowObject(comObject.queryInterface(IJIDispatch.IID));
}
开发者ID:howie,项目名称:jinterop,代码行数:13,代码来源:MSWMI.java
示例6: SampleTestServer
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public SampleTestServer(String address, String[] args) throws JIException, UnknownHostException {
this.address = address;
session = JISession.createSession(args[1], args[2], args[3]);
comStub = new JIComServer(JIProgId.valueOf("SampleTestServer.TestServer"), address, session);
IJIComObject unknown = comStub.createInstance();
comObject = (IJIComObject) unknown.queryInterface("1F438B1C-02BA-462E-A971-8E0640C141E5"); //ITestServer
}
开发者ID:howie,项目名称:jinterop,代码行数:8,代码来源:SampleTestServer.java
示例7: FirstContact_Stub
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public FirstContact_Stub(String address) throws Exception
{
JIArray arry123 = new JIArray(new Byte[10][0],true);
JIStruct struct123 = new JIStruct();
struct123.addMember(arry123);
struct123.addMember(0,new Integer(1));
struct123.addMember(0,new JIPointer(arry123));
//JIArray array = new JIArray(new short[]{0});
JISystem.setAutoRegisteration(true);
JISystem.setInBuiltLogHandler(false);
//Config.setProperty("jcifs.smb.client.domain","ITLINFOSYS");
session = JISession.createSession("FDGNT","roopchand","QweQwe007");
//session = JISession.createSession("10.74.85.56","itl-hw-38602a\\Vikram","[email protected]");
//session = JISession.createSession("federation","administrator","enterprise");
//stub = new JIComServer(JIClsid.valueOf("8B21775E-717D-11CE-AB5B-D41203C10000"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"TestCOM123.TestServer2"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"VirtualServer.Application"),address,session);
// stub = new JIComServer(JIProgId.valueOf(session,"ArrayTry.myarray"),address,session);
stub = new JIComServer(JIProgId.valueOf("ATLDemo.TestSafeArray"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"SafeArrayDemo.SafeArrayTest"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"Project1.Class1"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"TLI.TLIApplication"),address,session);
//stub = new JIComServer(JIProgId.valueOf(session,"TestSinglePtr.TestSinglePtr2"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:28,代码来源:FirstContact_Stub.java
示例8: MSInternetExplorer
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSInternetExplorer(String address, String[] args) throws JIException, UnknownHostException
{
JISystem.mapHostNametoIP("locutus", "192.168.0.130");
session = JISession.createSession(args[1],args[2],args[3]);
session.useNTLMv2(true);
session.useSessionSecurity(true);
comServer = new JIComServer(JIProgId.valueOf("InternetExplorer.Application"),address,session);
ieObject = comServer.createInstance();
IJIComObject ieObjectWebBrowser2 = (IJIComObject)ieObject.queryInterface("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E");
ieObjectDispatch = (IJIDispatch)JIObjectFactory.narrowObject((IJIComObject)ieObject.queryInterface(IJIDispatch.IID));
}
开发者ID:howie,项目名称:jinterop,代码行数:13,代码来源:MSInternetExplorer.java
示例9: MSExcel2
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSExcel2(String address, String[] args) throws JIException, UnknownHostException
{
session = JISession.createSession(args[1],args[2],args[3]);
// session.useSessionSecurity(true);
comServer = new JIComServer(JIProgId.valueOf("Excel.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:7,代码来源:MSExcel2.java
示例10: MSPowerPoint2
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSPowerPoint2(String address, String[] args) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
comStub = new JIComServer(JIProgId.valueOf("PowerPoint.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MSPowerPoint2.java
示例11: KainTest
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public KainTest(String address, String[] args) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("Word.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:KainTest.java
示例12: main
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) {
if (args.length < 4)
{
System.out.println("Please provide address domain username password");
return;
}
try {
JISystem.setAutoRegisteration(true);
JISystem.setInBuiltLogHandler(false);
JISystem.getLogger().setLevel(Level.ALL);
JISession session1 = JISession.createSession(args[1],args[2],args[3]);
JISession session2 = JISession.createSession(args[1],args[2],args[3]);
JIComServer testServer1 = new JIComServer(JIProgId.valueOf("TestJavaServer.TestServer1"),args[0],session1);
IJIComObject unkTestServer1 = testServer1.createInstance();
IJIComObject testServer1Intf = JIObjectFactory.narrowObject(unkTestServer1.queryInterface("2A93A24D-59FE-4DE0-B67E-B8D41C9F57F8"));
IJIDispatch dispatch1 = (IJIDispatch)JIObjectFactory.narrowObject(unkTestServer1.queryInterface(IJIDispatch.IID));;
//First lets call the ITestServer1.Call_TestServer2_Java using the Dispatch interface
//Acquire a reference to ITestServer2
JIComServer testServer2 = new JIComServer(JIProgId.valueOf("TestJavaServer.TestServer2"),args[0],session2);
IJIComObject unkTestServer2 = testServer2.createInstance();
//Get the interface pointer to ITestServer2
IJIComObject iTestServer2 = (IJIComObject)JIObjectFactory.narrowObject(unkTestServer2.queryInterface("9CCC5120-457D-49F3-8113-90F7E97B54A7"));
IJIDispatch dispatch2 = (IJIDispatch)JIObjectFactory.narrowObject(unkTestServer2.queryInterface(IJIDispatch.IID));;
//send it directly without IDispatch interface, please note that the "dispatchNotSupported" flag of JICallBuilder is "false".
JICallBuilder callObject = new JICallBuilder(false);
callObject.addInParamAsComObject(iTestServer2, JIFlags.FLAG_NULL);
callObject.setOpnum(0);
testServer1Intf.call(callObject);
//Send it to ITestServer.Call_TestServer2_Java2 via IDispatch of ITestServer1. Notice that pointer here id IDispatch.
dispatch1.callMethod("Call_TestServer2_Java2", new Object[]{new JIVariant(dispatch2)});
//Send it to ITestServer.Call_TestServer2_Java via IDispatch of ITestServer1.
dispatch1.callMethod("Call_TestServer2_Java", new Object[]{new JIVariant(iTestServer2)});
//Now for the Java Implementation of ITestServer2 interface (from the type library or IDL)
//IID of ITestServer2 interface
JILocalInterfaceDefinition interfaceDefinition = new JILocalInterfaceDefinition("9CCC5120-457D-49F3-8113-90F7E97B54A7");
//lets define the method "Execute" now. Please note that either this should be in the same order as defined in IDL
//or use the addInParamAsObject with opnum parameter function.
JILocalParamsDescriptor parameterObject = new JILocalParamsDescriptor();
parameterObject.addInParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_REPRESENTATION_STRING_BSTR);
JILocalMethodDescriptor methodDescriptor = new JILocalMethodDescriptor("Execute",1,parameterObject);
interfaceDefinition.addMethodDescriptor(methodDescriptor);
//Create the Java Server class. This contains the instance to be called by the COM Server ITestServer1.
JILocalCoClass _testServer2 = new JILocalCoClass(interfaceDefinition,new Test_ITestServer2_Impl());
//Get a interface pointer to the Java CO Class. The template could be any IJIComObject since only the session is reused.
IJIComObject __testServer2 = JIObjectFactory.buildObject(session1,_testServer2);
//Call our Java server. The same message should be printed on the Java console.
dispatch1.callMethod("Call_TestServer2_Java", new Object[]{new JIVariant(__testServer2)});
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:howie,项目名称:jinterop,代码行数:70,代码来源:Test_ITestServer2_Impl.java
示例13: MSShell
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
MSShell(String args[]) throws UnknownHostException, JIException
{
session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("Shell.Application"),args[0],session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MSShell.java
示例14: MSExcel2_Test
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSExcel2_Test(String address, String[] args) throws JIException, UnknownHostException
{
session = JISession.createSession(args[1],args[2],args[3]);
session.useSessionSecurity(true);
comServer = new JIComServer(JIProgId.valueOf("Excel.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:7,代码来源:MSExcel2_Test.java
示例15: MSExcel3
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSExcel3(String address, String args[]) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("Excel.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MSExcel3.java
示例16: QtpComTest
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public QtpComTest(String address, String domain, String username, String password) throws JIException, UnknownHostException{
JISystem.getLogger().setLevel(Level.FINEST);
/*Let the j-Interop library do this for you. You can set the "autoRegistration" flag in the
JISystem class. When the library encounters a "Class not registered" exception, it will
perform all the registry changes if the autoRegistration flag is set. And then re-attempt
loading the COM Server. Please have a look at MSSysInfo,MSWMI examples.*/
JISystem.setAutoRegisteration(true);
session = JISession.createSession(domain,username,password);
comServer = new JIComServer(JIProgId.valueOf("QuickTest.Application"), address, session);
// session.setGlobalSocketTimeout(30000);
}
开发者ID:howie,项目名称:jinterop,代码行数:22,代码来源:QtpComTest.java
示例17: MSTypeLibraryBrowser2
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSTypeLibraryBrowser2(String address, String args[]) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
session.useSessionSecurity(true);
comServer = new JIComServer(JIProgId.valueOf(args[4]),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:7,代码来源:MSTypeLibraryBrowser2.java
示例18: MSTypeLibraryBrowser
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MSTypeLibraryBrowser(String address, String args[]) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("InternetExplorer.Application"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MSTypeLibraryBrowser.java
示例19: MetrikonOPC
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
public MetrikonOPC(String address, String[] args) throws JIException, UnknownHostException
{
JISession session = JISession.createSession(args[1],args[2],args[3]);
comStub = new JIComServer(JIProgId.valueOf("Matrikon.OPC.Simulation"),address,session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MetrikonOPC.java
示例20: MSOutLookExpressContacts
import org.jinterop.dcom.core.JIProgId; //导入依赖的package包/类
MSOutLookExpressContacts(String args[]) throws UnknownHostException, JIException
{
session = JISession.createSession(args[1],args[2],args[3]);
comServer = new JIComServer(JIProgId.valueOf("Outlook.Application"),args[0],session);
}
开发者ID:howie,项目名称:jinterop,代码行数:6,代码来源:MSOutLookExpressContacts.java
注:本文中的org.jinterop.dcom.core.JIProgId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论