Пример #1
0
 public bool Create(FileSystemInfo f)
 {
     this.StartInfo.WorkingDirectory = Path.GetDirectoryName(f.FullName);
     this.StartInfo.Arguments        = "-p -a " + Protect.ToInsecureString(Protect.DecryptString(BiblioUpTik.Properties.Settings.Default.AnnounceURL)) + " " + (34.ToString() + f.FullName + (object)'"');
     this.InterProc = new Process()
     {
         StartInfo = this.StartInfo
     };
     this.InterProc.Start();
     Thread.Sleep(BiblioUpTik.Properties.Settings.Default.Delay);
     return(File.Exists(f.FullName + ".torrent"));
 }
Пример #2
0
 public Settings()
 {
     this.InitializeComponent();
     this.usernameBox.Text       = BiblioUpTik.Properties.Settings.Default.Username;
     this.passwordBox.Text       = Protect.ToInsecureString(Protect.DecryptString(BiblioUpTik.Properties.Settings.Default.Password));
     this.delayBox.Value         = BiblioUpTik.Properties.Settings.Default.Delay >= 100 ? (BiblioUpTik.Properties.Settings.Default.Delay <= 5000 ? (Decimal)BiblioUpTik.Properties.Settings.Default.Delay : new Decimal(5000)) : new Decimal(100);
     this.templateBox.Text       = BiblioUpTik.Properties.Settings.Default.Template;
     this.addBox.Checked         = BiblioUpTik.Properties.Settings.Default.OnRun;
     this.coverBox.Checked       = BiblioUpTik.Properties.Settings.Default.GetCover;
     this.pagesBox.Checked       = BiblioUpTik.Properties.Settings.Default.GetPages;
     this.publisherBox.Checked   = BiblioUpTik.Properties.Settings.Default.GetPublisher;
     this.descriptionBox.Checked = BiblioUpTik.Properties.Settings.Default.GetDescription;
     this.secureBox.Checked      = BiblioUpTik.Properties.Settings.Default.Secure;
     this.widthBox.Value         = (Decimal)BiblioUpTik.Properties.Settings.Default.Width;
     this.heightBox.Value        = (Decimal)BiblioUpTik.Properties.Settings.Default.Height;
     this.showCoverBox.Checked   = BiblioUpTik.Properties.Settings.Default.ShowCover;
     this.announceBox.Text       = Protect.ToInsecureString(Protect.DecryptString(BiblioUpTik.Properties.Settings.Default.AnnounceURL));
 }
Пример #3
0
 public static string EncryptString(SecureString input)
 {
     return(Convert.ToBase64String(ProtectedData.Protect(Encoding.Unicode.GetBytes(Protect.ToInsecureString(input)), Protect.entropy, DataProtectionScope.CurrentUser)));
 }