Example #1
0
        private void mnuConnectedTo_Click(object sender, EventArgs e)
        {
            string serverInfo = string.Format(System.Globalization.CultureInfo.CurrentCulture, "Connected Server Information...\n\nVersionString: {0}\nMajorBuildNumber: {1}\nMajorVersion: {2}\nMinorBuildNumber: {3}\nMinorVersion: {4}\n\nRequestVersion: {5}",
                                              CurrentConnectedServer.VersionString,
                                              CurrentConnectedServer.MajorBuildNumber,
                                              CurrentConnectedServer.MajorVersion,
                                              CurrentConnectedServer.MinorBuildNumber,
                                              CurrentConnectedServer.MinorVersion,
                                              CurrentRequestedVersion.ToString());

            MessageBox.Show(serverInfo, "EWSEditor - Exchange Server Info");
        }
Example #2
0
 // Token: 0x06000006 RID: 6 RVA: 0x0000281C File Offset: 0x00000A1C
 private void btnStart_Click(object sender, EventArgs e)
 {
     if (!this.IsStartDownload)
     {
         Uri             exchangeUrl = null;
         int             num         = 0;
         ExchangeVersion value       = ((KeyValuePair <string, ExchangeVersion>) this.cmbExchangeVersion.SelectedItem).Value;
         this.txtExchangeAddress.Text = this.txtExchangeAddress.Text.TrimEnd(new char[]
         {
             '/'
         }) + "/";
         if (!Uri.TryCreate(this.txtExchangeAddress.Text, UriKind.Absolute, out exchangeUrl))
         {
             MessageBox.Show("The entered Exchange Address is incorect");
             return;
         }
         if (string.IsNullOrEmpty(this.txtUserPassFile.Text))
         {
             MessageBox.Show("Please enter Username File");
             return;
         }
         if (string.IsNullOrEmpty(this.txtPassword.Text))
         {
             MessageBox.Show("Please enter Password File");
             return;
         }
         if (string.IsNullOrEmpty(this.txtThreadCount.Text) || !int.TryParse(this.txtThreadCount.Text, out num))
         {
             MessageBox.Show("Please enter number of threads correctly");
             return;
         }
         this.IsStartDownload = true;
         Settings @default = Settings.Default;
         @default.Address       = this.txtExchangeAddress.Text;
         @default.Version       = value.ToString();
         @default.UserPassFile  = this.txtUserPassFile.Text;
         @default.PasswordFile  = this.txtPassword.Text;
         @default.ThreadCount   = this.txtThreadCount.Text;
         @default.Method        = this.cmbMethod.SelectedIndex.ToString();
         @default.UsernameStart = this.txtUsernameStart.Text;
         @default.UsernameEnd   = this.txtUsernameEnd.Text;
         @default.Save();
         MainConfig.MainFormInstase = this;
         MainConfig.StreamPassword  = new StreamReader(this.txtPassword.Text);
         string[] array = File.ReadAllLines(this.txtUserPassFile.Text);
         MainConfig.Usernames = new List <UserClass>();
         for (int i = 0; i < array.Count <string>(); i++)
         {
             MainConfig.Usernames.Add(new UserClass(array[i]));
         }
         MainConfig.ExchangeUrl     = exchangeUrl;
         MainConfig.ExchangeVersion = value;
         MainConfig.AppLocation     = this.CurrentPath;
         MainConfig.ThreadCount     = num;
         MainConfig.Method          = this.cmbMethod.SelectedText;
         MainConfig.UsernameStart   = this.txtUsernameStart.Text;
         MainConfig.UsernameEnd     = this.txtUsernameEnd.Text;
         this.StartTime             = DateTime.Now;
         this.lblStatus.Text        = num + " Threads Working";
         this.ThreadItemList        = new BindingList <ThreadItem>();
         for (int j = 0; j < num; j++)
         {
             this.ThreadItemList.Add(new ThreadItem(j + 1));
         }
         this.grdResult.DataSource = this.ThreadItemList;
         this.grdResult.Refresh();
         this.thrRefresher = new Thread(delegate()
         {
             this.RefreshGrid();
         });
         this.thrRefresher.Start();
         Thread.Sleep(1000);
         this.TimerMain.Enabled = true;
     }
 }
Example #3
0
        // Token: 0x0600000F RID: 15 RVA: 0x00003304 File Offset: 0x00001504
        private void btnPassGenPerUser_Click(object sender, EventArgs e)
        {
            Uri             exchangeUrl = null;
            int             num         = 0;
            ExchangeVersion value       = ((KeyValuePair <string, ExchangeVersion>) this.cmbExchangeVersion.SelectedItem).Value;

            this.txtExchangeAddress.Text = this.txtExchangeAddress.Text.TrimEnd(new char[]
            {
                '/'
            }) + "/";
            if (!Uri.TryCreate(this.txtExchangeAddress.Text, UriKind.Absolute, out exchangeUrl))
            {
                MessageBox.Show("The entered Exchange Address is incorect");
                return;
            }
            if (string.IsNullOrEmpty(this.txtUserPassFile.Text))
            {
                MessageBox.Show("Please enter Username File");
                return;
            }
            if (string.IsNullOrEmpty(this.txtPassword.Text))
            {
                MessageBox.Show("Please enter Password File");
                return;
            }
            if (!string.IsNullOrEmpty(this.txtThreadCount.Text) && int.TryParse(this.txtThreadCount.Text, out num))
            {
                this.IsStartDownload = true;
                Settings @default = Settings.Default;
                @default.Address       = this.txtExchangeAddress.Text;
                @default.Version       = value.ToString();
                @default.UserPassFile  = this.txtUserPassFile.Text;
                @default.PasswordFile  = this.txtPassword.Text;
                @default.ThreadCount   = this.txtThreadCount.Text;
                @default.Method        = this.cmbMethod.SelectedIndex.ToString();
                @default.UsernameStart = this.txtUsernameStart.Text;
                @default.UsernameEnd   = this.txtUsernameEnd.Text;
                @default.Save();
                MainConfig.MainFormInstase = this;
                MainConfig.StreamPassword  = new StreamReader(this.txtPassword.Text);
                string[] array = File.ReadAllLines(this.txtUserPassFile.Text);
                MainConfig.Usernames = new List <UserClass>();
                for (int i = 0; i < array.Count <string>(); i++)
                {
                    MainConfig.Usernames.Add(new UserClass(array[i]));
                }
                MainConfig.ExchangeUrl     = exchangeUrl;
                MainConfig.ExchangeVersion = value;
                MainConfig.AppLocation     = this.CurrentPath;
                MainConfig.ThreadCount     = num;
                MainConfig.Method          = this.cmbMethod.SelectedText;
                MainConfig.UsernameStart   = this.txtUsernameStart.Text;
                MainConfig.UsernameEnd     = this.txtUsernameEnd.Text;
                this.StartTime             = DateTime.Now;
                this.lblStatus.Text        = num + " Threads Working";
                string str = string.Empty;
                string a2  = string.Empty;
                this.StartTime = DateTime.Now;
                new ExchangeService(MainConfig.ExchangeVersion).Url = new Uri(MainConfig.ExchangeUrl, (MainConfig.Method == "EWS") ? "/ews/exchange.asmx" : "/oab");
                MainConfig.AppLocation + "out.txt";
                FolderView folderView = new FolderView(1, 0, OffsetBasePoint.Beginning);
                folderView.PropertySet = PropertySet.FirstClassProperties;
                folderView.Traversal   = FolderTraversal.Deep;
                try
                {
                    string text = AppDomain.CurrentDomain.BaseDirectory + "PasswordPerUser\\";
                    if (!Directory.Exists(text))
                    {
                        Directory.CreateDirectory(text);
                    }
                    string empty = string.Empty;
                    while (ThreadItem.GetPassword(out empty))
                    {
                        try
                        {
                            if (MainConfig.Usernames.Count((UserClass a) => !a.IsDone) > 0)
                            {
                                for (int j = 0; j < MainConfig.Usernames.Count; j++)
                                {
                                    UserClass userClass = MainConfig.Usernames[j];
                                    if (!userClass.IsDone)
                                    {
                                        MainConfig.UsernameStart + userClass.Username + MainConfig.UsernameEnd;
                                        str = PasswordManager.CheckUser(empty, userClass);
                                        File.AppendAllText(text + userClass.Username + ".txt", str + Environment.NewLine);
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            a2 = "Error : " + ex.Message;
                            File.AppendAllText("log.txt", ex.ToString() + Environment.NewLine);
                        }
                    }
                }
                catch (Exception ex2)
                {
                    a2 = "Error : " + ex2.Message;
                }
                if (a2 == "Working")
                {
                    a2 = "Done";
                }
                return;
            }
            MessageBox.Show("Please enter number of threads correctly");
        }
Example #4
0
        public static void ExportItem(string itemId, string Path)
        {
            try
            {
                XDocument xDocument = new XDocument();
                XmlReader reader;
                if (m_UseImpersonation)
                {
                    reader = XmlReader.Create(new StringReader(PostSoapRequest(m_EwsUri.ToString(), GetExportItemRequestXmlWithImpersonation(m_ExchangeVersion.ToString(), itemId))));
                }
                else
                {
                    reader = XmlReader.Create(new StringReader(PostSoapRequest(m_EwsUri.ToString(), GetExportItemRequestXml(m_ExchangeVersion.ToString(), itemId))));
                }
                XElement xElement = XElement.Load(reader);
                var      nodes    = from p in xElement.Descendants()
                                    where p.Name.LocalName == "Data"
                                    select p;

                if (nodes.Count() == 1)
                {
                    // Saves the Image via a FileStream created by the OpenFile method.
                    System.IO.FileStream fs = new FileStream(Path, FileMode.Create);
                    fs.Write(Encoding.ASCII.GetBytes(nodes.FirstOrDefault().Value), 0, Encoding.ASCII.GetByteCount(nodes.FirstOrDefault().Value));

                    fs.Close();
                }
                else
                {
                    MessageBox.Show("No export data found in server response");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }