VS 2008 Performance File Read/Compare?

Sep 15, 2009

this time im looking for a faster-than-fast way to read binary files into a string/buffer/whatever, like Delphi's BlockRead does.i need this for an application that checks a list of folders/files and looks for multiple files, and handles them according to specific criteria.

I know there are standard solutions for this, like DuplicateFileRemover (gotta love that sheep! ), but i need something custommade, coz i want to handle the duplicates automatically too, and im talking about GigaBytes of data i have to periodically clean out this way..So far, the algorithm i use to determine if 2 files are equal is this:

[Code]...

View 1 Replies


ADVERTISEMENT

VS 2008 Read/compare Particular Line From Textfile?

Aug 18, 2009

I have a 2 textfiles with a few lines of text.

e.g. textfile1

pos1:1
pos2:10
pos3:1

[Code].....

I need to open both files and compare the lines without knowing which line is different. (mgsbox (pos2.value)<< something like this)

View 4 Replies

VS 2008 Network File Copy Performance?

Jun 24, 2010

I'm hoping someone can point me in a different direction. I'm copying files from one computer to another. Both are on the same switch connected at 1Gbps here's my problem:Using File.Copy with a list of files I can get an average transfer speed of ~60Mbps Using multiple background workers with a split list of files and File.Copy is slower Using the FileStream read/write method I get an average speed of ~55Mbps with a 8M buffer

What can I do to get a faster transfer rate? I'd be happy to hit 250Mbps over the LAN.

View 39 Replies

VS 2008 Compare Lines Within A .csv File

Nov 1, 2009

I am looking to compare lines within a .csv file. I want to start at the bottom line and compare values within it to those in the line above and then repeat the process, ie. the second bottom line to the third bottom line and so on.The code used to compare straight out variables I can handle, the difficultly for me lies in identifying particular lines and fields within a text file.If someone would be kind enough to provide the code for this, I have googled it but it's clearly beyond my ability.

View 1 Replies

VS 2008 : Download File And Compare Strings?

Oct 25, 2010

I have this Class:

vb
Imports System.IOImports System.NetImports System.Text Public Class TEST Public Shared DOWNLOAD_LINK As String Public Shared Downuri As String Public Shared Sub Main() Dim URI As String URI = "http://MYWEBSITE.COM/test.html" Dim wr As

[code]....

As you can see this class get the .html text and copy to one .txt file. Then it reads the .txt file. Now I just need to compare the string it read with one string from another form... How do I do it? Do I need to change the code?

View 6 Replies

VS 2008 Compare Lines Within A Text File?

Jan 20, 2012

I would like to read a txt file and then check if the same name exist within its sublevel.If found within the sublevel, delte those line.sample txt file:

4272840.ASM M97 BLOC DE CLIMATISATION DENZO VERSION A/C AUTOMATIQUE AUTOMATIC A/C VERSION AIR CONDITIONING BLOCK DENZO F9206101
3786687.ASM M1 -- BLOC CLIM AUTO

[code].....

View 8 Replies

VS 2008 File Compare And Copy Or Rename?

Nov 3, 2009

I am helping a friend convert files from floppy to CD. The files are in WordPerfect for DOS (8.3)format. she named the files as follows: name.month eg; Baker.jan. if there were more than 1 "Baker" files in the same month she named them baker1.jan,Baker2.jan etc... She then copied them to floppies and when one got full she started another. The problem is I have multiple instances of the same filename on different disks so when I copy to my HD windows asks if I want to overwrite the files. I have been writing the names down and renaming them manually. Is there any way to automate this process? I would need to perform the following:

1. Check if floppy filename exists on HD already
2. if it doesn't, copy to HD
3. if it does, is it the same file or different file with the same name (file size has been a good indicator so far)
4.If it's the same =>ignore and go to next file on disk
5. if different, rename then copy to HD then go to next file
6. repeat until all files have been copied

I have 300+ disks to do this with and it is very time consuming.

View 7 Replies

VS 2008 - Compare Text File From Server With Local And Download

Jul 20, 2009

I'm willing to compare a textfile (whatever) which contains a few lines of text. After the comparison it should download and replace the "changed" folder/file. E.g.

(Local txtFile)
maps: 1.0.0
db1: 1.0.0
db2. 1.0.0

(Server txtFile)
maps: 1.0.1
db1: 1.0.0
db2. 1.0.0

View 9 Replies

VS 2008 - .txt File - Write The File Path So That Someone Else Can Download My Program And File And Read The File

Feb 27, 2012

Reading a .txt file in VB.net. My file path is C:UsersMyLilMulePepeDocumentsVisual Studio 2008Projectscurtain_calls.txt.

This is my line of Dim LoanOptionsFile As String = "C:UsersMyLilMulePepeDocumentsVisual Studio 2008Projectscurtain_calls.txt"

I can read the file when I run the program, but how do I write the file path so that someone else can download my program and file and read the file on their system?

View 3 Replies

Compare Version Between Host And Client Download The File If Compare Version Not Same In .net?

May 20, 2011

they need to make some compare version between host version and client version.. and each 1 version different will download the file to the client..[URL]..with both example, how can i make a program in VB.NET just like i said just now?

View 15 Replies

Performance - Trim A Log File With .net?

Oct 29, 2010

I'm writing a simple application in vb.net and need to output some information to a log file for diagnostic purposes.In order to ensure that the log file doesn't get too big, I need to trim it to a certain number of lines (say 5000). For performance reasons, the trimming doesn't have to occur each time a log entry is written out nor is it critical that trimming occurs (for example, if the application crashes prematurely).

However I'm not really sure the best way to trim it. Loading the entire log into memory and then re-writing only the last 5000 lines back out would work, but I'm sure there is a cleaner and better way to do this.

View 3 Replies

Performance Reading Text File?

Jun 14, 2012

i have this simple code from a vb.net project:

Using sr As New StreamReader(NewSwitch.ActFolder & NewSwitch.ActSShowName)
worker.ReportProgress(LoadSwitchProgressType.Normal, "Loading Active SupportShow, size " & NewSwitch.ActSShowSize & "...")
NewSwitch.ActSShowData = sr.ReadToEnd
End Using

Obviously it reads a file - a 20M text file to be exact. Now if this 20M file is on my PC, it reads in about a second. If i open this same file in a text editor, such as Conext, its about the same.However, if this 20m File is on a network location, the Context text editor loads the file in about 1 min 40 seconds. I would have expected similar times with my vb.net code, but it took 7 minutes 45 seconds.I have no idea what the text editor uses to read a file, but i figure i must be able to get similar time in vb.net somehow.

View 2 Replies

Streamreader - Text File - To Read Into A Listview - Read From A Specific Line In That File

Mar 11, 2010

I have a txt file that I need to read into a listview, but I need to read from a specific line in that file. Below is a sample of the txt file to read,

6400,3200,2,95.5,84,76.6,0
1,2,-20,15,0,0,0,"NO",0,0
TOTAL GPM= 6400 HWT= 95.5 CWT= 84.0 IWBT= 76.6 ALTITUDE= 0

CODE]...

View 1 Replies

Thread Performance Text File Splitting

Oct 14, 2009

Thread Performance text file splitting

View 1 Replies

VS 2008 RTB LoadFile Performance?

Sep 22, 2010

I am working in VB.Net and loading word documents into an RTB. Most of the files I'm loading are small 2 to 60KB and have no problems. Occasionally, I have files that are upwards of 11,000KB. It takes approximately 2 minutes to get these loaded into the control. Is there anything I can do to boost performance when loading these files?

View 2 Replies

VB 2008 - How To Read INI File

Feb 2, 2009

We are working with vb 2008 and we made script for reading a INI file. Is there a more simple way for reading a INI file? In vb60 we used a dll for reading.

View 7 Replies

VS 2008 Read .dat File?

Sep 26, 2009

VS 2008 Read .dat file

View 9 Replies

VS 2008 Read End Of File?

May 26, 2009

I want to read 4 lines OR 400 chars from the end of a log file.The log file will be huge so im seaching a way to not read the whole file into the memory.

vb.net
Dim filel As Long = My.Computer.FileSystem.GetFileInfo(logfile).Length
Dim buf(400) As Char
Dim fs As New IO.StreamReader(logfile)
fs.Read(buf, filel - 400, 400)

I've also tried with FileStream but i keep getting this error:"Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection."But why doesn't it work with filel - 400 as index? It works if i just switch it with 0?

View 8 Replies

VS 2008 Read XML File?

Sep 4, 2010

I am looking to read the xml file according to the block i have in the file.for the example i have 2 Support and Operator, i need some code where i can only read the support or operator nodes.Here is my xml file.

<?xml version="1.0" encoding="iso-8859-1"?>
<main>
<Support>

[code]....

View 5 Replies

VS 2008 - GC.Collect: Memory Vs Performance?

Jan 29, 2011

I have an application (i've been working on for a long time) that has many tabs and controls and quite a few components And a good deal of design code. And a list box that has around 100k items (i had to put a loader to pass the 3-4 seconds while its loading to prevent it from not-responding)I had a few Gc.collect calls in specific places (mostly after many items are added or removed). When my application loads, i call GC.collect only once at the end of the load. The program consumes around 35K memory by the time its loaded. However, i decided to mess around abit (don't worry i made backups)First i started putting gc.collect in some random places, and to my surprise the memory upon loading was observably decreasing. Then I went ahead and put a macro that puts GC.Collect before every End Sub, Exit Function, Exit Sub, and Return value, there is. Basically every block in my application had atleat one GC.Collect.
I fixed some 6 or 7 silly replace errors and compiled. When the program launched, the memory used at the end of launch was 21K!

At first glance that seemed great, but then i realized switching between tabs was VERY glitchy. and adding new lists took around 10x more time than usual (the loader stayed on for around 20 seconds!) And even though the memory looked good, the program was useless like this.Then i decided to mess around differently. I removed GC.Collect from the entire solution. It was no longer called even once.At first glance, when i launched the app it consumed just under 60K memory. That seemed terrible. However i realized something: even though my program in that state showed on taskmanager that it was consuming alot more memory than usual, it seemed like it was lighter than ever! Switching tabs was faster than before, especially every time i go to the tab that has the listbox control with 100k items. Loading items took around 3-4 seconds, but there was no stutter when the list finished loading whereas before it had an evident 0.3s stutter after the items were added.

This was all surprising to me because i thought GC.Collect was first of all, something that it doesnt matter where or how many times you call it. I thought it was just something that should be called at the end of work and i didnt think it would matter if it was called during work.Second of all, i thought GC.Collect only affected resources that are inaccessible, or resources my program is done with. How come the application feels faster when i don't call it?Third of all, i thought the VB CLR does most of the memory cleaning for me, and that GC.Collect was somewhat of a redundant command. It didn't seem so redundant to me at all considering the difference between using it heavily and not using it at all was around 38K in memory usage!

So i guess my questions are:
1) Do I need to call GC.Collect? WhereWhen do i call it?2) Why does calling it affect performance? And where does one draw the line between that memory stat on taskmanager and the program's performance?3) I also decided to run a small test. Why does a blank vb form application require 10K memory? How accurate is that stat shown on the task manager?

View 3 Replies

VS 2008 Resource Files And App Performance?

Nov 30, 2009

I'm not sure if I'm gonna feel like an idiot after posting this, but here goes . I have taken my first shot a writing a code generator. not too shabby for my first go round, but I already see some ways it can be vastly improved. Not there yet, however. One of the things this code generator does is pull text templates (MANY text templates! Over and OVER again!) from a project resource file. I have added them to the resource designer as linked text files.

Now, the way the generator is written, there can at times be a LOT of iteration (think writing property declarations for a Classs which represents a database entity, as well as the backing fields for those property declarations, etc.).

Is there any significant performance hit to repeatedly accessing a resource? I have looked around on msdn and this forum (and will continue to investigate), but I am hoping someone can give me some clarification.

I SUSPECT that use of a resource file means a trip to the Hard drive each time one accesses it . . . Right? It IS a FILE, linked by it's PATH, right? Due to it's having been designated as a project resource, id a resource file somehow "magially" made available in memory, so that the disk round trip is not necessary?

I suspect I should be retreiving popular resources into a persisted Class-level variable if I plan to use them often within a specific class scope, and at the method level if I plan to perform a significant number of iterations whihc require the resource within the method.

AM I on the right track, or is the resource retreival trivial? I am NOT concerned about milking maximum performance out of a generator tool; it is acceptable for this process to take a little time. However, I also don't want to be sloppy unecessarily.

View 2 Replies

[2008] Application Performance Explorer?

Mar 25, 2009

Stupid question, but how do I get access to this Explorer? To create a performance session for Windows client application:(1) Open the solution in the Visual Studio IDE. (2) On the Analyze menu, click Launch Performance Wizard.(3) From the Which of the following available targets would you like toprofile? drop-down list, select the name of the application that you wantto profile, and then click Next. You can add more binaries later

View 3 Replies

VS 2008 How Can The Program Read File

Sep 7, 2009

how can i make the program read the name of a file in the same direction i want to make a program that when the user write the name of the file the program make search in the same directory and the open it

View 8 Replies

VS 2008 How To Read A Text File

Jul 2, 2009

I am learning Visual Basic and I have learned alot of it from the learning section included in Visual Basic Express Edition 2008 but I don't think I have learned alot. I am actually trying to make an extractor and importer for a game. I have the file called Frontened.MNG and I want to make a program that can open the file. Someone else had made the rxtractor but he doesn't have it now. The Frontened.MNG file contains bunch of .DDS files and I want to view them in the program and then be able to replace the .DDS files in the >MNG file and be able to Extract the files out of the .MNG file. I don't just want anyone to do it for me but teach me how to do it step by step. First I want to know is how to view the .MNG file in VB? It should be viewed in a listbox but I don't know how to read this file in VB. I know how to read a text file but I think this is a binary file and it is viewed differently.

View 6 Replies

VS 2008 Read A Txt File After Commas?

May 22, 2009

I want to read a text file that has multiple lines and commas on every line, every comma represents a value, like an integer or boolean. here is an example

50, 100, 50, 50, True, "C:WINDOWSWhatever.jpg"

I want to read each individual line from the text file and read the values after the comma's.

So the first value would be a picturebox height, the value after the second comma would be the width, the value after the third would be the top, after that the left, and then stretch image, and the location of the image. How could I do this?

Here is a simpler version.

Height, Width, Top, Left, Stretch?, ImageLocation

how to read individual lines in text files.

View 39 Replies

VS 2008 Read An Xml File Into A Program

Apr 20, 2011

I want to read an xml file into a program and i am getting confused as to which commands to use. [code]my ultimate aim is to convert the xml files into an sql database file

View 2 Replies

VS 2008 Read Data From Xml File

Feb 7, 2010

how I access it (aside from the ComboBox display method shown) in a way that will allow me to process it.What I want to do is read the data, store each of the values, then do some work on it. Can anyone give me a clue how I can access the information contained in 'DataSource'? [code]

View 3 Replies

VS 2008 Read Sections Of A File?

Feb 13, 2010

I'm making a program in C#, but I want to test out part of the program I'm going to integrate into it in VB, and what I want to do is divide a file into sections. The files range from 60mb to around 180mb, and I know that it is really hard to open files of that size, so for my app I want it to divide the file into smaller sections and put files in a folder temporarily so It could just read them from there. And I want to break it down to about, 5-10mb per file.

View 1 Replies

VS 2008 Read Some File That Is Encoded With UTF-8?

Nov 6, 2009

I was trying to read some file that is encoded with UTF-8 and save it as UTF-16 (Unicode) but it seems not to be fully working as all accents seem to vanish or are encoded to something that can not be read.

Here is the code that i am using:

Public Function GetFileContents(ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As Object
Dim strContents As String

[Code].....

View 1 Replies

VS 2008 Read The Log File Without Locking It?

Feb 5, 2010

I'm writing a log parser which is reading a log created by a game. This log can be written to many times a second. My problem is that my program is preventing the writing of the log at times. Is there anyway I can read the log file without locking it?

Sub readLog()
If readyToRead Then
If FileInUse(fileName) Then Return
readyToRead = False

[code]....

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved