VB.NET binary file access using FileGet/Put is slowwww...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: VB.NET binary file access using FileGet/Put is slowwww...

  1. #1
    Tln1 Guest

    VB.NET binary file access using FileGet/Put is slowwww...


    Ok, I am using some old VB6 style Put/Get statements to read/write binary
    files using structures in VB/NET. This structure is defined like this for
    VB.NET:

    Public Structure COGO_PT
    Dim ID As Byte
    Dim PT As Short
    <VBFixedArray(20)> Dim DESC() As Byte
    Dim NO As Double
    Dim EA As Double
    Dim EL As Double
    End Structure

    Opening a 3meg file and saving it to another file in VB6 takes about 2 seconds
    on my P800mhz. The same operation in VB.NET (in which the file access function
    is virtually identical to the VB6 code) takes almost 30 seconds! The file
    access is generally 10-20 times slower than the very same VB6 code? Should
    I be using the Binary stream reader? Am I doing something wrong with this
    structure definition?

    Any help would be appreciated,
    Tannks,
    Terry


  2. #2
    Cali LaFollett Guest

    Re: VB.NET binary file access using FileGet/Put is slowwww...

    > Ok, I am using some old VB6 style Put/Get statements to read/write binary
    > files using structures in VB/NET. This structure is defined like this for
    > VB.NET:


    I would personally recommend using the .NET Framework System.IO namespace to
    do this. All the Put/Get VB.NET calls do is wrap the .NET functionality.

    > Opening a 3meg file and saving it to another file in VB6 takes about 2

    seconds
    > on my P800mhz. The same operation in VB.NET (in which the file access

    function
    > is virtually identical to the VB6 code) takes almost 30 seconds! The file
    > access is generally 10-20 times slower than the very same VB6 code? Should
    > I be using the Binary stream reader? Am I doing something wrong with this
    > structure definition?


    I am not sure it is your structure. I would be more curious to see your IO
    code or at least the portions that you can show.

    I haven't had to do a lot of File IO in .NET yet as I haven't need that
    functionality so maybe a few that have had extensive use with it can pop by
    and give their recommendations.

    Regards,

    Cal



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center