本文介绍了C#自动化BlueZone大型机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好。关于使用C#编写的智能客户端应用程序对BlueZone mainfrmae使用自动化,我得到了Rocket Software的人们的以下回复:



是的,我们有客户在做它,BlueZone自动化对象使用COM。 C#有一种生成包装类来调用COM对象的方法。



有没有人能成功做到这一点,你有没有任何代码片段?



谢谢你,WHEELS

Good morning. Regarding using automation to the BlueZone mainfrmae using a smart client application written in C#, I got the following response from the folks at Rocket Software:

Yes, we have customers doing it, the BlueZone automation objects use COM. C# has a way of generating wrapper classes to invoke COM objects.

Has anyone successfully been able to do this, and do you have any code snippets?

Thank you, WHEELS

推荐答案

public class clsBZ
    {
        private string _usr;
        private string _pwd;
        public BZWHLLLib.WhllObj Session;
        private string _sessionID;


        private void startSession()
        {
            if (Session == null)
            {
                Session = new BZWHLLLib.WhllObj();
                Session.Connect(_sessionID);

            }
        }

        public string getValue(int row, int colm, int valSize)
        {
            Object tmp = "";
            Session.ReadScreen(out tmp, valSize, row, colm);
            return tmp.ToString();
        }

        public void putValue(string value, int row, int colm)
        {
            Session.WaitReady(0, 51);
            Session.SetCursor(row, colm);
            Session.SendKey(value);
            Session.WaitReady(0, 51);
        }

    }


这篇关于C#自动化BlueZone大型机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 23:51