Welcome to the ThinManager Knowledgebase.
Additional knowledgebase articles can be found at Rockwell Automation Tech Support.

If you would like to speak with one of our engineers, please Submit a Question or give us a call at the phone number here. In North America, To route your phone support request directly to a technical support engineer, call toll-free 1-888-382-1583 or 1-440-646-3434, select Option 3 (Technical Support), then select Option 5 (More Options). When prompted, enter the ThinManager Direct Dial Code 201.

Difference between revisions of "TermMon Demo Program Source"

From ThinManager Knowledge Base
Jump to: navigation, search
(Created page with "Insert source here <pre> using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System...")
(No difference)

Revision as of 21:23, 13 September 2012

Insert source here

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Diagnostics;

namespace TermMon_Demo
{
    public enum CommandConst
    {
        TermSecureCheckAccess = -2,
        ChangeTerminalServerGroup = -1,
    }

    public partial class Form1 : Form
    {
        public string[] args;
        public bool console;
        public Form1()
        {
            InitializeComponent();
            if (console) this.Visible = false;

            EnableControl(true);
            ChangeEnabled(false);

            textBoxConnectionState.Text = "Disconnected";
            textBoxConnectionState.BackColor = System.Drawing.Color.LightGray;

            Assembly a = Assembly.GetExecutingAssembly();
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(a.Location);
            labelVersion.Text = "Version " + fvi.ProductVersion;
        }

        private void WaitForConnection()
        {
            timer2.Enabled = true;
        }

        private void EnableControl(bool enabled)
        {
            groupBoxDemoControl.Enabled = enabled;
            groupBoxOverrideIP.Enabled = enabled;
        }

        private void ChangeEnabled(bool enabled)
        {
            groupBoxTerminalInfo.Enabled = enabled;
            groupBoxTerminalControl.Enabled = enabled;
            groupBoxSessionControl.Enabled = enabled;
            groupBoxNavigation.Enabled = enabled;
            groupBoxGetDisplayClientScreen.Enabled = enabled;
            groupBoxTermSecure.Enabled = enabled;
            groupBoxCameraOverlay.Enabled = enabled;
            groupBoxActiveScreen.Enabled = enabled;
            groupBoxWatchdog.Enabled = enabled;
            buttonEnable.Enabled = !enabled;
            buttonDisable.Enabled = enabled;
        }

        private string ResultLookup(int res)
        {
            switch(res)
            {
                case (short)TERMMONLib.TermMonConst.Busy:
                    return "Busy";
                case (short)TERMMONLib.TermMonConst.Connected:
                    return "Connected";
                case (short)TERMMONLib.TermMonConst.Disconnected:
                    return "Disconnected";
                case (short)TERMMONLib.TermMonConst.Fail:
                    return "Failed";
                case (short)TERMMONLib.TermMonConst.GroupNotFound:
                    return "Group Not Found";
                case (short)TERMMONLib.TermMonConst.InvalidMember:
                    return "Invalid Member";
                case (short)TERMMONLib.TermMonConst.RequestFailed:
                    return "Request Failed";
                case (short)TERMMONLib.TermMonConst.Success:
                    return "Success";
                case (short)TERMMONLib.TermMonConst.Timeout:
                    return "Timeout";
                case (short)TERMMONLib.TermMonConst.Updating:
                    return "Updating";
                case (short)TERMMONLib.TermMonConst.UserNotFound:
                    return "User Not Found";
                case (short)TERMMONLib.TermMonConst.ValidMember:
                    return "Valid Member";
                case (short)TERMMONLib.TermMonConst.BadPassword:
                    return "Bad Password";
                case (short)TERMMONLib.TermMonConst.NoPermission:
                    return "No Permission";
                case (short)TERMMONLib.TermMonConst.NoWindowsPassword:
                    return "No Windows Password";
                case (short)TERMMONLib.TermMonConst.NoWindowsUsername:
                    return "Now Windows Username";
                case (short)TERMMONLib.TermMonConst.PasswordChangeReq:
                    return "Password Change Required";
                default:
                    return "Error: Other";
            }
        }