Click here to Skip to main content
15,917,632 members
Home / Discussions / C#
   

C#

 
GeneralRe: The type or namespace name could not be found Pin
PIEBALDconsult16-Sep-07 11:11
mvePIEBALDconsult16-Sep-07 11:11 
GeneralRe: The type or namespace name could not be found Pin
Lutosław16-Sep-07 11:20
Lutosław16-Sep-07 11:20 
GeneralRe: The type or namespace name could not be found Pin
PIEBALDconsult16-Sep-07 15:05
mvePIEBALDconsult16-Sep-07 15:05 
GeneralRe: The type or namespace name could not be found Pin
Lutosław16-Sep-07 8:48
Lutosław16-Sep-07 8:48 
GeneralRe: The type or namespace name could not be found Pin
Lutosław16-Sep-07 9:13
Lutosław16-Sep-07 9:13 
QuestionAdd connection Pin
Assaf8216-Sep-07 4:42
Assaf8216-Sep-07 4:42 
AnswerRe: Add connection Pin
PIEBALDconsult16-Sep-07 5:12
mvePIEBALDconsult16-Sep-07 5:12 
GeneralRe: Add connection Pin
Assaf8216-Sep-07 5:53
Assaf8216-Sep-07 5:53 
AnswerRe: Add connection Pin
Paul Conrad16-Sep-07 6:44
professionalPaul Conrad16-Sep-07 6:44 
GeneralRe: Add connection Pin
Assaf8216-Sep-07 6:50
Assaf8216-Sep-07 6:50 
GeneralRe: Add connection Pin
Paul Conrad16-Sep-07 7:00
professionalPaul Conrad16-Sep-07 7:00 
AnswerRe: Add connection Pin
Guffa16-Sep-07 7:18
Guffa16-Sep-07 7:18 
AnswerRe: Add connection Pin
PIEBALDconsult16-Sep-07 8:27
mvePIEBALDconsult16-Sep-07 8:27 
Questionpopulating grid Pin
rcwoods16-Sep-07 2:38
rcwoods16-Sep-07 2:38 
AnswerRe: populating grid Pin
Ravi Bhavnani16-Sep-07 4:03
professionalRavi Bhavnani16-Sep-07 4:03 
AnswerRe: BinaryReader BinaryWriter Pin
Guffa16-Sep-07 2:23
Guffa16-Sep-07 2:23 
AnswerFileSize Pin
jblouir16-Sep-07 4:18
jblouir16-Sep-07 4:18 
AnswerRe: FileSize Pin
Guffa16-Sep-07 6:02
Guffa16-Sep-07 6:02 
QuestionError while duplicating a form! Pin
Muammar©16-Sep-07 0:42
Muammar©16-Sep-07 0:42 
AnswerOk, I found the solution Pin
Muammar©16-Sep-07 1:59
Muammar©16-Sep-07 1:59 
Questioncontrol panel languages Pin
md_refay15-Sep-07 23:39
md_refay15-Sep-07 23:39 
QuestionSlow binary reader Pin
Xmen Real 15-Sep-07 23:30
professional Xmen Real 15-Sep-07 23:30 
hi there,
i m reading a binary but it takes so long time to read, here is the codes

FileStream fs = new FileStream(@"D:\art1.bar", FileMode.Open);
            
            
            BinaryReader br = new BinaryReader(fs);
            string chk = "";
            for (int a = 0; a < 4; a++)
            {
                chk += br.ReadChar().ToString();
            }
            int version = br.ReadInt32();
            int unknown = br.ReadInt32();
            byte[] uselessbytes = br.ReadBytes(264);
            int unknown1 = br.ReadInt32();
            int tnums = br.ReadInt32();
            long dir = br.ReadInt64();
            byte[] byts = br.ReadBytes(tnums); 
            br.BaseStream.Position = dir;
            int dirnamelength = br.ReadInt32();
            dirnamelength *= 2;
            string dirname = "";


            for (int a = 0; a < dirnamelength; a++)
            {
                dirname += br.ReadChar().ToString();
            }
            dirname = dirname.Replace("\0", "");
            dirname = dirname.Replace("\\", "");
            dirname = dirname.Replace(" ", "");
            int numofFilesindir = br.ReadInt32();

            for (int a = 0; a < numofFilesindir; a++)
            {
                dataGridView1.Rows.Add();
                dataGridView1[1, a].Value = br.ReadInt32();
                dataGridView1[2, a].Value = br.ReadInt32();
                br.BaseStream.Position += 20;
                int filelength = br.ReadInt32();
                filelength *= 2;
                string filename = "";

                for (int b = 0; b < filelength; b++)
                {
                    filename += br.ReadChar();
                }
                filename = filename.Replace("\0", "");
                filename = filename.Trim();
                filename.Remove(filename.Length - 3);
                dataGridView1[0, a].Value = filename;


            }


           
            br.Close();
            fs.Close();

it taking 15 seconds to read about 7000 files(i.e numofFilesindir = 7000)

i wanna know how can i reduce time or any alternative way that read fast

Becoming Programmer...

AnswerRe: Slow binary reader [modified] Pin
User 665816-Sep-07 1:02
User 665816-Sep-07 1:02 
GeneralRe: Slow binary reader Pin
Xmen Real 16-Sep-07 4:34
professional Xmen Real 16-Sep-07 4:34 
GeneralRe: Slow binary reader Pin
Dave Kreskowiak16-Sep-07 5:56
mveDave Kreskowiak16-Sep-07 5:56 

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.