Click here to Skip to main content
15,888,218 members
Home / Discussions / C#
   

C#

 
GeneralRe: USB device being in use Pin
Blubbo8-May-13 8:23
Blubbo8-May-13 8:23 
GeneralRe: USB device being in use Pin
Gerry Schmitz8-May-13 11:12
mveGerry Schmitz8-May-13 11:12 
QuestionIs streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 3:42
turbosupramk33-May-13 3:42 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
GuyThiebaut3-May-13 4:21
professionalGuyThiebaut3-May-13 4:21 
GeneralRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 4:51
turbosupramk33-May-13 4:51 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
Pete O'Hanlon3-May-13 4:24
mvePete O'Hanlon3-May-13 4:24 
GeneralRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 5:13
turbosupramk33-May-13 5:13 
AnswerRe: Is streamreader slow compared to other text import functions? Pin
turbosupramk33-May-13 5:14
turbosupramk33-May-13 5:14 
This code is very quick in case someone else can learn from my mistake, thank you both for helping me through this.

C#
private void vcfProcessor(object filePathObj)
        {
            try
            {
                string filePath = filePathObj.ToString();
                using (StreamReader reader = new StreamReader(filePath))
                {
                    List<string> vcfFile = new List<string>();
                    string readLine;
                    while ((readLine = reader.ReadLine()) != null)
                    {
                        vcfFile.Add(readLine);
                    }
                    int count = 0;
                    foreach (string line in vcfFile)
                    {
                        if (line == "BEGIN:VCARD")
                        {
                            count = count + 1;
                            lbxOutput.Items.Add(count + ".) ").ToString();
                        }

                        lbxOutput.Items.Add(line + System.Environment.NewLine);

                        if (line == "END:VCARD")
                        {
                            lbxOutput.Items.Add(System.Environment.NewLine);
                        }
                        if (count % 50 == 0)
                        {
                            tbxContactNumber.Text = count.ToString();
                            Application.DoEvents();
                        }
                    }
                    tbxContactNumber.Text = count.ToString();
                }


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + System.Environment.NewLine + ex.Source + System.Environment.NewLine + ex.TargetSite + System.Environment.NewLine + ex.StackTrace + System.Environment.NewLine + System.Environment.NewLine);
            }
        }

GeneralRe: Is streamreader slow compared to other text import functions? Pin
DaveyM693-May-13 13:47
professionalDaveyM693-May-13 13:47 
QuestionEvent/Delegate for progress bar issue Pin
MichCl3-May-13 3:13
MichCl3-May-13 3:13 
AnswerRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 7:21
professionalEddy Vluggen3-May-13 7:21 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 7:31
MichCl3-May-13 7:31 
AnswerRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 8:29
professionalEddy Vluggen3-May-13 8:29 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 8:39
MichCl3-May-13 8:39 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 8:53
professionalEddy Vluggen3-May-13 8:53 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:22
MichCl3-May-13 9:22 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:25
MichCl3-May-13 9:25 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen3-May-13 9:40
professionalEddy Vluggen3-May-13 9:40 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl3-May-13 9:48
MichCl3-May-13 9:48 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen4-May-13 0:41
professionalEddy Vluggen4-May-13 0:41 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 3:40
MichCl6-May-13 3:40 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen6-May-13 7:52
professionalEddy Vluggen6-May-13 7:52 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl6-May-13 9:19
MichCl6-May-13 9:19 
GeneralRe: Event/Delegate for progress bar issue Pin
MichCl7-May-13 2:09
MichCl7-May-13 2:09 
GeneralRe: Event/Delegate for progress bar issue Pin
Eddy Vluggen7-May-13 3:16
professionalEddy Vluggen7-May-13 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.