0

如何通过Jawin连接 QC(OTAClient.dll) 。糊涂了

Dispatchptr("TDApiOle80.TDConnection") 

我不能使用 Jawin 类型浏览器。

4

1 回答 1

0
try{
            Ole32.CoInitialize();
            DispatchPtr qc = new DispatchPtr("TDApiOle80.TDConnection");

            qc.invoke("InitConnectionEx", new String("URL"));
            qc.invoke("Login", "username", "password");
            System.out.println("\nAUTHENTCATED");
            qc.invoke("Connect", "domainname", "projname");
            System.out.println("\nCONNECTED");

            DispatchPtr testSetFolder = (DispatchPtr) qc.get("TestSetTreeManager");

            testSetFolder = (DispatchPtr) testSetFolder.get("Root");
            testSetFolder = (DispatchPtr) testSetFolder.invoke("AddNodeDisp", "Jawin_008Folder");
            testSetFolder.invoke("post");

            DispatchPtr testSet=(DispatchPtr)testSetFolder.get("TestSetFactory");         
            testSet=(DispatchPtr)testSet.invoke("AddItem", "Jawin007_testSet007");

            testSet.put("Name","JawintestSet_007");
            testSet.put("Status","Open");
            testSet.invoke("Post");

            System.out.println("Test SET Created");   

            if((Boolean)qc.get("Connected"))
            {
                if((Boolean)qc.get("LoggedIn"))
                {
                    qc.invoke("Logout");
                    System.out.println("Logged out");
                }
            }

            qc.invoke("Disconnect");
            System.out.print("\nDISCONNECTED");
            qc.invoke("ReleaseConnection");
            Ole32.CoUninitialize();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
于 2012-03-21T13:00:13.367 回答