コード例 #1
0
        internal void RunRemoteSoftware(UserControls.RemoteSoftware sof, string ComputerName)
        {
            string Options = sof.Options;

            Options = Options.Replace("{computerName}", ComputerName);
            if (Options.Contains("{userName}"))
            {
                Options = Options.Replace("{userName}", Properties.Settings.Default.txt_AdminUser);
            }
            if (Options.Contains("{password}"))
            {
                Options = Options.Replace("{password}", Utility.AdminPassword);
            }

            Task.Run(() =>
            {
                StartProcess(sof.ProgramPath, Options);
            });

            AdminCredentialsAndRemoteSoftware acr = App.AdminCredentialsAndRemoteSoftware;

            acr.UserName = Properties.Settings.Default.txt_AdminUser;
            // acr.SecureStringPassword = Utility.AdminPassword.ToSecure();
            acr.Password     = Utility.AdminPassword;
            acr.Arguments    = Options;
            acr.FileName     = sof.ProgramPath;
            acr.Domain       = Properties.Settings.Default.txt_Domain;
            acr.ComputerName = ComputerName;
        }
コード例 #2
0
        private void btnBrows_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            System.Windows.Controls.Button b   = (sender as System.Windows.Controls.Button);
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            RemoteSoftware re = (b.Tag as RemoteSoftware);

            dlg.Title = string.Format("Brows for {0} exe", re.Name);


            Nullable <bool> result = dlg.ShowDialog();

            // Get the selected file name and display in a TextBox
            if (result == true)
            {
                //TextBox te = FindVisualChildren<TextBox>(this).Where(t => t.Text == re.ProgramPath).FirstOrDefault();
                //te.Text = dlg.FileName;
                re.ProgramPath = dlg.FileName;
            }
        }
コード例 #3
0
        public void RunRemoteSoftware(UserControls.RemoteSoftware sof, string ComputerName, string comboboxUserName)
        {
            string Options = sof.Options;


            Options = Options.Replace("{computerName}", ComputerName);
            if (Options.Contains("{userName}"))
            {
                Options = Options.Replace("{userName}", Properties.Settings.Default.txt_AdminUser);
            }
            if (Options.Contains("{password}"))
            {
                Options = Options.Replace("{password}", Utility.AdminPassword);
            }
            if (Options.Contains("{comboboxUserName}"))
            {
                Options = Options.Replace("{comboboxUserName}", comboboxUserName);
            }

            StartProcess(sof.ProgramPath, Options);
        }
コード例 #4
0
        //private void UserControl_Unloaded(object sender, RoutedEventArgs e)
        //{
        //    SaveAllRemoteSoftware();
        //    if (NewRemoteSoftware != null)
        //        NewRemoteSoftware(true);
        //    obRemoteSoftware.Clear();
        //    obRemoteSoftware = null;
        //}

        //private void SaveAllRemoteSoftware()
        //{
        //    xml.Save(obRemoteSoftware);
        //}

        private void RadioDefault_Checked(object sender, RoutedEventArgs e)
        {
            RemoteSoftware remo = ((sender as System.Windows.Controls.RadioButton).Tag) as RemoteSoftware;

            remo.Default = true;
        }