using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NiApiLib;

namespace Connection
{
    class Program
    {
        static void Main(string[] args)
        {
            Connection c = new Connection();
            c.connect();
            Console.ReadLine();
            c.disconnect();
        }
    }
    class Connection
    {
        NiApiLib.SrvrSession Session = new NiApiLib.SrvrSessionClass();
        public void connect()
        {
            Session.HostAddr = "nidemo.mfd.ru";
            Session.HostPort = 2900;
            Session.Name = "test";
            Session.Password = "12345678";
            Session.CatalogName = "catalog.xml";
            Session.OnLogin+=new _ISrvrSessionEvents_OnLoginEventHandler(Session_OnLogin);
            Session.Connect();
        }
        public void disconnect()
        {
            Session.Disconnect();
        }

        public void Session_OnLogin(int LoginResult)
        {

        }
    }
}

