示例#1
0
        internal static void Main(string[] args)
        {
            // Setup an Authentication Session

            AuthenticationSession session = new AuthenticationSession();

            session.serviceUser         = Configuration.Default.API_Username;
            session.serviceUserPassword = Configuration.Default.API_Password;
            session.customerApiKey      = Configuration.Default.API_CustomerKey;
            session.userApiKey          = Configuration.Default.API_UserKey;
            Console.WriteLine("Establishing a Web Service session.  One moment...");
            session.open();

            try
            {
                if (args[0].ToString().ToLower() == "-form")
                {
                    ShowWindow(GetConsoleWindow(), CONSOLE_HIDE);
                    Application.EnableVisualStyles();
                    Form ui = new UIForm(session);
                    Application.Run(ui);
                }
                else
                {
                    FindAddresses(session.token);
                }
            }
            catch (Exception)
            {
                FindAddresses(session.token);
            }
        }
示例#2
0
 public UIForm(AuthenticationSession session)
 {
     InitializeComponent();
     if (session != null)
     {
         status.Text = "Successfully Connected";
     }
     apiUser.Text      = session.serviceUser;
     sessionToken.Text = session.token;
     ActiveControl     = inputQuery;
     AcceptButton      = btnSubmit; // enter will submit the query.
 }