Пример #1
0
 private void btnSetDefault_Click(object sender, EventArgs e)
 {
     if (RPMessageBox.ShowQuestion("This will remove all entries and replace them with the default recording folder - are you sure?", "Revert to default recording path") == DialogResult.Yes)
     {
         SetDefaultRecordingPath();
     }
 }
Пример #2
0
 private void btnHelpWin7Libraries_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (RPMessageBox.ShowQuestion("If this box is checked, Remote Potato ignores this list and uses the folders in your Windows 7 " + CollectionName + " library instead.\r\n\r\nDo you wish to edit these folders now?", "Help on Windows 7 " + CollectionName + " library") == System.Windows.Forms.DialogResult.Yes)
     {
         RPMessageBox.ShowAlert("Remote Potato will open a Windows Explorer window.  To add/remove " + CollectionName + " folders, you should look for the heading 'Libraries' in the left-hand column, then right-click the word '" + CollectionName + "' and choose 'Properties'.");
         string target = "explorer.exe";
         System.Diagnostics.Process.Start(target);
     }
 }
        private void btnClose_Click(object sender, EventArgs e)
        {
            if (RPMessageBox.ShowQuestion("Remote Potato for iOS allows you to stream all your music, pictures and video directly to your iPhone or iPad.\r\n\r\nWould you like to read more about the app now?", "Remote Potato for iPhone/iPad") == System.Windows.Forms.DialogResult.Yes)
            {
                ShowIOSAppWebPage();
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Пример #4
0
        private void llAddFirewall_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (RPMessageBox.ShowQuestion("Most connection problems can be solved by either changing the settings on either your router or Windows Firewall.\r\n\r\nWould you like to read more about this online now?", "Solve Connection Problems") == DialogResult.No)
            {
                return;
            }

            string target = "http://forums.fatattitude.com/viewforum.php?f=12";

            System.Diagnostics.Process.Start(target);
        }
Пример #5
0
        public static void AskThenAddFirewallRules()
        {
            if (RPMessageBox.ShowQuestion("Do you use Windows Firewall?  If so, we can add rules to your firewall to allow Remote Potato to be accessed over the Internet.  You will only ever need to do this once, unless you change port numbers.\r\n\r\nDo you want to do this now?", "Add Firewall Rules?") == DialogResult.No)
            {
                return;
            }

            if (AddFirewallRules())
            {
                RPMessageBox.Show("The rules were successfully added to Windows Firewall.\r\n\r\nRemember, you do not need to do this again unless you change port numbers.");
            }
            else
            {
                RPMessageBox.ShowAlert("There was an error adding the rules to Windows Firewall - see debug log for more information.\r\n\r\nClick the 'Re-add firewall rules' button to try this again.");
            }
        }
Пример #6
0
        void TryToChangeMediaLibraryAccount()
        {
            lblStatus.Text = "Please wait - making changes...";
            Application.DoEvents();

            string AccountName = txtMediaLibraryUsername.Text.Trim();
            string Password    = txtMediaLibraryPassword.Text.Trim();

            if (string.IsNullOrEmpty(AccountName))
            {
                lblStatus.Text = "You must enter the details of a user of this machine.";
                return;
            }

            if (string.IsNullOrEmpty(Password))
            {
                // Services require a login with a password if limited in registry  see http://stackoverflow.com/questions/1047854/cant-run-a-service-under-an-account-which-has-no-password
                if (Functions.IsBlankPasswordLimitedOnMachine)
                {
                    if (RPMessageBox.ShowQuestion("Blank passwords for services are currently limited on this machine.\r\n\r\nDo you wish to lift this security restriction so that Remote Potato can run?", "Allow blank passwords on machine?")
                        == DialogResult.Yes)
                    {
                        Functions.SetBlankPasswordLimitOnMachine(false);
                    }
                    else
                    {
                        RPMessageBox.Show("To allow Remote Potato to run, please use an account that has a Username and a Password");
                        return;
                    }
                }
            }
            else  // re-instate blank password limit?
            {
                if (!Functions.IsBlankPasswordLimitedOnMachine)
                {
                    if (RPMessageBox.ShowQuestion("Blank passwords for services are currently allowed on this machine.  Unless you require this security relaxation for other services or remotely access user accounts on this machine that have no password, you should re-enable this security restriction.\r\n\r\nDo you wish to forbid blank passwords for services?", "Forbid blank passwords on machine?")
                        == DialogResult.Yes)
                    {
                        Functions.SetBlankPasswordLimitOnMachine(true);
                    }
                }
            }

            if (!ValidateCredentials(AccountName, Password))
            {
                lblStatus.Text = "The log on details that you entered were incorrect.";
                return;
            }



            //if (!SetServiceLogon("Remote Potato Service", AccountName, Password, true)) return;
            string strErrorText = string.Empty;

            if (!ServiceManager.SetRPServiceLogon(AccountName, Password, false, ref strErrorText))
            {
                lblStatus.Text = "Could not use this account - please check the details:" + strErrorText;
                return;
            }

            if (!SetLogOnAsServiceRight(AccountName))
            {
                RPMessageBox.ShowAlert("Could not add required security priviliges to this account - please check that you running as an Administrator, and that you have entered the details correctly.");
                lblStatus.Text = "Error setting priviliges.";
                return;
            }

            lblStatus.Text = string.Empty;
            CommitAndClose();
        }