当前位置: 首页>>代码示例>>C#>>正文


C# Microsoft.Win32.OpenFileDialog.ToString方法代码示例

本文整理汇总了C#中Microsoft.Win32.OpenFileDialog.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Win32.OpenFileDialog.ToString方法的具体用法?C# Microsoft.Win32.OpenFileDialog.ToString怎么用?C# Microsoft.Win32.OpenFileDialog.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Win32.OpenFileDialog的用法示例。


在下文中一共展示了Microsoft.Win32.OpenFileDialog.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btn_ScrapeUser_MentionUser_BrowseMessageorURL_Click

        private void btn_ScrapeUser_MentionUser_BrowseMessageorURL_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.DefaultExt = ".txt";
                dlg.Filter = "Text documents (.txt)|*.txt";
                Nullable<bool> result = dlg.ShowDialog();
                string Path = dlg.ToString().Replace("Microsoft.Win32.OpenFileDialog: Title: , FileName", "");
                if (result == true)
                {
                    this.Dispatcher.Invoke(new Action(delegate
                    {
                        txt_ScrapeUsers_MentionUser_LoadPhotoIDOrUrlsPath.Text = dlg.FileName;
                    }));

                    List<string> lstTemp = Globussoft.GlobusFileHelper.ReadFiletoStringList(dlg.FileName);
                    GlobalDeclration.objScrapeUser.listOfMessageToComment = lstTemp.Distinct().ToList();

                    GlobusLogHelper.log.Info(lstTemp.Count + " Message Loaded ");
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error ==> " + ex.StackTrace);
            }
        }
开发者ID:sumitglobussoft,项目名称:GramDominator-2.0,代码行数:27,代码来源:UserControlScrapeUserWhereToMention.xaml.cs

示例2: LoadAccounts

        public void LoadAccounts()
        {
            try
            {
               
                DataSet ds;

                DataTable dt = new DataTable();

                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.DefaultExt = ".txt";
                dlg.Filter = "Text documents (.txt)|*.txt";
                Nullable<bool> result = dlg.ShowDialog();
                string Path = dlg.ToString().Replace("Microsoft.Win32.OpenFileDialog: Title: , FileName", "");
                if (result == true)
                {
                    DateTime sTime = DateTime.Now;

                    dt.Columns.Add("UserName");
                    dt.Columns.Add("Password");
                    dt.Columns.Add("Niches");
                    dt.Columns.Add("ProxyAddress");
                    dt.Columns.Add("ProxyPort");
                    dt.Columns.Add("ProxyUserName");
                    dt.Columns.Add("ProxyPassword");
                    //dt.Columns.Add("Useragent");
                   // dt.Columns.Add("BoardsName");
                    dt.Columns.Add("ScreenName");
                    dt.Columns.Add("LoginStatus");

                    ds = new DataSet();
                    ds.Tables.Add(dt);

                    List<string> templist = GlobusFileHelper.ReadFile(dlg.FileName);

                    if (templist.Count > 0)
                    {
                        PDGlobals.loadedAccountsDictionary.Clear();
                        PDGlobals.listAccounts.Clear();
                    }

                    if (Globals.IsBasicVersion)
                    {
                        try
                        {
                            string selectQuery = "select count(UserName) from tb_emails";
                            DataSet DS = DataBaseHandler.SelectQuery(selectQuery, "tb_emails");
                            int countLoadedAccounts = Convert.ToInt32(DS.Tables[0].Rows[0].ItemArray[0].ToString());

                            if (countLoadedAccounts >= 5)
                            {
                                AccounLoad();
                                MessageBox.Show("You Are Using PD Basic Version 5 Accounts allready loaded..");
                                return;
                            }
                            else
                            {
                                int RemainingAccount = 5 - countLoadedAccounts;

                                templist.RemoveRange(RemainingAccount, templist.Count - RemainingAccount);

                            }
                        }
                        catch { }
                    }
                    if (Globals.IsProVersion)
                    {
                        try
                        {
                            string selectQuery = "select count(UserName) from tb_emails";
                            DataSet DS = DataBaseHandler.SelectQuery(selectQuery, "tb_emails");
                            int countLoadedAccounts = Convert.ToInt32(DS.Tables[0].Rows[0].ItemArray[0].ToString());

                            if (countLoadedAccounts >= 15)
                            {
                                AccounLoad();
                                MessageBox.Show("You Are Using PD Pro Version 15 Accounts allready loaded..");
                                return;
                            }
                            else
                            {
                                int RemainingAccount = 15 - countLoadedAccounts;

                                templist.RemoveRange(RemainingAccount, templist.Count - RemainingAccount);

                            }
                        }
                        catch { }
                    }
                    int counter = 0;

                    foreach (string item in templist)
                    {
                        //if (Globals.CheckLicenseManager == "fdfreetrial" && counter == 5)
                        //{
                        //    break;
                        //}
                        counter = counter + 1;
                        try
                        {
//.........这里部分代码省略.........
开发者ID:sumitglobussoft,项目名称:pinDominator-3.0,代码行数:101,代码来源:UploadAccount.xaml.cs

示例3: LoadAccounts

        private void LoadAccounts()
        {
            this.Dispatcher.Invoke(new Action(delegate
            {
                AccountViewModel._listOfAccount.Clear();
            }));
            DataSet ds;

            DataTable dt = new DataTable();

            DateTime sTime = DateTime.Now;
            try
            {


                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.DefaultExt = ".txt";
                dlg.Filter = "Text documents (.txt)|*.txt";
                Nullable<bool> result = dlg.ShowDialog();
                string Path = dlg.ToString().Replace("Microsoft.Win32.OpenFileDialog: Title: , FileName", "");

                if (result == true)
                {


                    dt.Columns.Add("UserName");
                    dt.Columns.Add("Password");
                    dt.Columns.Add("ProxyAddress");
                    dt.Columns.Add("ProxyPort");
                    dt.Columns.Add("ProxyUserName");
                    dt.Columns.Add("ProxyPassword");

                    ds = new DataSet();
                    ds.Tables.Add(dt);

                    List<string> templist = GlobusFileHelper.ReadFile(dlg.FileName);

                    if (templist.Count > 0)
                    {
                        IGGlobals.loadedAccountsDictionary.Clear();


                    }
                    if (Globals.IsBasicVersion)
                    {
                        try
                        {
                            string selectQuery = "select count(UserName) from AccountInfo";
                            DataSet DS = DataBaseHandler.SelectQuery(selectQuery, "AccountInfo");
                            int countLoadedAccounts = Convert.ToInt32(DS.Tables[0].Rows[0].ItemArray[0].ToString());

                            if (countLoadedAccounts >= 5)
                            {
                                LoadAccountsFromDataBase();
                                GlobusLogHelper.log.Info("You Are Using ID Basic Version 5 Accounts allready loaded..");
                              // MessageBox.Show("You Are Using ID Basic Version 5 Accounts allready loaded..");
                             //  AccounLoad();
                              // LoadAccountProgressBar.IsIndeterminate = false;
                              //  ModernDialog.ShowMessage("You Are Using ID Basic Version 5 Accounts allready loaded..", "Message", MessageBoxButton.OK);
                                this.Dispatcher.Invoke(new Action(delegate
                                    {
                                        LoadAccountProgressBar.IsIndeterminate = false;
                                    }));
                                return;
                            }
                            else
                            {
                                int RemainingAccount = 5 - countLoadedAccounts;

                                templist.RemoveRange(RemainingAccount, templist.Count - RemainingAccount);

                            }
                        }
                        catch { }
                    }
                    if (Globals.IsProVersion)
                    {
                        try
                        {
                            string selectQuery = "select count(UserName) from AccountInfo";
                            DataSet DS = DataBaseHandler.SelectQuery(selectQuery, "AccountInfo");
                            int countLoadedAccounts = Convert.ToInt32(DS.Tables[0].Rows[0].ItemArray[0].ToString());

                            if (countLoadedAccounts >= 15)
                            {
                                LoadAccountsFromDataBase();
                                MessageBox.Show("You Are Using ID Pro Version 15 Accounts allready loaded..");
                                AccounLoad();
                                LoadAccountProgressBar.IsIndeterminate = false;
                                return;
                            }
                            else
                            {
                                int RemainingAccount = 15 - countLoadedAccounts;

                                templist.RemoveRange(RemainingAccount, templist.Count - RemainingAccount);

                            }
                        }
                        catch { }
//.........这里部分代码省略.........
开发者ID:sumitglobussoft,项目名称:GramDominator-2.0,代码行数:101,代码来源:ManageAccounts.xaml.cs

示例4: LoadAccounts

        private void LoadAccounts()
        {

            try
            {
                DataSet ds;
                
                DataTable dt = new DataTable();

                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.DefaultExt = ".txt";
                dlg.Filter = "Text documents (.txt)|*.txt";
                Nullable<bool> result = dlg.ShowDialog();
                string Path = dlg.ToString().Replace("Microsoft.Win32.OpenFileDialog: Title: , FileName","");
                if (result == true)
                {
                    DateTime sTime = DateTime.Now;

                    dt.Columns.Add("UserName");
                    dt.Columns.Add("Password");
                    dt.Columns.Add("ProxyAddress");
                    dt.Columns.Add("ProxyPort");
                    dt.Columns.Add("ProxyUserName");
                    dt.Columns.Add("ProxyPassword");

                    ds = new DataSet();
                    ds.Tables.Add(dt);

                    List<string> templist = GlobusFileHelper.ReadFile(dlg.FileName);

                    if (templist.Count > 0)
                    {
                        IGGlobals.loadedAccountsDictionary.Clear();
                      //  IGGlobals.listAccounts.Clear();
                       
                    }
                    int counter = 0;
                    
                    foreach (string item in templist)
                    {
                        if (Globals.CheckLicenseManager == "fdfreetrial" && counter == 5)
                        {
                            break;
                        }
                        counter = counter + 1;
                        try
                        {
                            string account = item;
                            string[] AccArr = account.Split(':');
                            if (AccArr.Count() > 1)
                            {
                                string accountUser = account.Split(':')[0];
                                string accountPass = account.Split(':')[1];
                                string proxyAddress = string.Empty;
                                string proxyPort = string.Empty;
                                string proxyUserName = string.Empty;
                                string proxyPassword = string.Empty;
                                string status = string.Empty;

                                int DataCount = account.Split(':').Length;
                                if (DataCount == 2)
                                {
                                    //Globals.accountMode = AccountMode.NoProxy;

                                }
                                else if (DataCount == 4)
                                {

                                    proxyAddress = account.Split(':')[2];
                                    proxyPort = account.Split(':')[3];
                                }
                                else if (DataCount > 5 && DataCount < 7)
                                {

                                    proxyAddress = account.Split(':')[2];
                                    proxyPort = account.Split(':')[3];
                                    proxyUserName = account.Split(':')[4];
                                    proxyPassword = account.Split(':')[5];

                                }
                                else if (DataCount == 7)
                                {

                                    proxyAddress = account.Split(':')[2];
                                    proxyPort = account.Split(':')[3];
                                    proxyUserName = account.Split(':')[4];
                                    proxyPassword = account.Split(':')[5];

                                }

                                dt.Rows.Add(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword);
                                Qm.DeleteAccounts(accountUser);
                                Qm.AddAccountInDataBase(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword, Path);
                             

                                try
                                {
                                    InstagramUser objInstagramUser = new InstagramUser("","","","");
                                    objInstagramUser.username = accountUser;
                                    objInstagramUser.password = accountPass;
//.........这里部分代码省略.........
开发者ID:sumitglobussoft,项目名称:instagram-dominator-2.0,代码行数:101,代码来源:ManageAccounts.xaml.cs


注:本文中的Microsoft.Win32.OpenFileDialog.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。