Click here to Skip to main content
15,888,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Formless application's icon Pin
The Man from U.N.C.L.E.10-Dec-04 0:48
The Man from U.N.C.L.E.10-Dec-04 0:48 
GeneralFormat a Row in DataGrid Pin
m_dhakshna7-Dec-04 10:25
m_dhakshna7-Dec-04 10:25 
GeneralRe: Format a Row in DataGrid Pin
Pablo.ar7-Dec-04 13:16
Pablo.ar7-Dec-04 13:16 
GeneralRe: Format a Row in DataGrid Pin
Anonymous7-Dec-04 16:30
Anonymous7-Dec-04 16:30 
QuestionSingleton Strongly-Typed Dataset? Pin
Mark Farmiloe7-Dec-04 7:14
Mark Farmiloe7-Dec-04 7:14 
GeneralKeypress mimic Mouse click Pin
TAlvord7-Dec-04 5:59
TAlvord7-Dec-04 5:59 
GeneralReading/Writing large files Pin
Zenly7-Dec-04 1:45
Zenly7-Dec-04 1:45 
GeneralRe: Reading/Writing large files Pin
Dave Kreskowiak7-Dec-04 3:52
mveDave Kreskowiak7-Dec-04 3:52 
Since your using .ReadToEnd, yes, it will bring your system to a halt while the reader is busy filling RAM with 200MB of data. Any other solution will be slower, but will not hold Windows hostage until it completes:
Function GoReadFileToString(ByVal lvFilePath As String) As String()
    If File.Exists(lvFilePath) = True Then
        Dim Index As Integer = 0
        Dim lvReadFileOut() As String
        Dim fsStream As New FileStream(lvFilePath, FileMode.Open, FileAccess.Read)
        Dim srReader As New StreamReader(fsStream)
        Do While srReader.Peek > 0
            lvReadFileOut(Index) = srReader.ReadLine()
            Replace(lvReadFileOut(Index), "d:\directory1", "")
            Application.DoEvents()
        Loop
        srReader.Close()
        Return (lvReadFileOut)
    End If
End Function

But, why would you want to read 200MB of data anyway? Why not just create a class that wraps the file and opens it, reads it one line at a time PER CALL by the client using the class, does it's replace processing and then returns the line to the called. When the caller is done, it can call a Close method in your class to release the file. MUCH less RAM will be consumed using a process like this and you won't have to worry about the system dropping 200MB into the swap file.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Reading/Writing large files Pin
Zenly7-Dec-04 5:12
Zenly7-Dec-04 5:12 
GeneralRe: Reading/Writing large files Pin
Dave Kreskowiak7-Dec-04 5:51
mveDave Kreskowiak7-Dec-04 5:51 
GeneralRe: Reading/Writing large files Pin
Zenly7-Dec-04 6:40
Zenly7-Dec-04 6:40 
GeneralUrgent - ThreadPool Pin
cwayman7-Dec-04 0:27
cwayman7-Dec-04 0:27 
GeneralHANDLES - Windows Messages Pin
rdges6-Dec-04 22:42
rdges6-Dec-04 22:42 
GeneralHelp required with Regular Expressions Pin
vbvjain6-Dec-04 18:52
vbvjain6-Dec-04 18:52 
QuestionMain Menu Bar Color? Pin
Sumit Domyan6-Dec-04 18:00
Sumit Domyan6-Dec-04 18:00 
AnswerRe: Main Menu Bar Color? Pin
Dave Kreskowiak7-Dec-04 5:56
mveDave Kreskowiak7-Dec-04 5:56 
GeneralAuto-scroll ListView Pin
xshi0056-Dec-04 16:48
xshi0056-Dec-04 16:48 
GeneralRe: Auto-scroll ListView Pin
Pablo.ar7-Dec-04 0:54
Pablo.ar7-Dec-04 0:54 
GeneralRe: Auto-scroll ListView Pin
xshi0057-Dec-04 9:05
xshi0057-Dec-04 9:05 
GeneralRe: Auto-scroll ListView Pin
Pablo.ar7-Dec-04 9:18
Pablo.ar7-Dec-04 9:18 
GeneralRe: Auto-scroll ListView Pin
xshi0057-Dec-04 9:45
xshi0057-Dec-04 9:45 
GeneralRe: Auto-scroll ListView Pin
Pablo.ar7-Dec-04 13:06
Pablo.ar7-Dec-04 13:06 
GeneralRe: Auto-scroll ListView Pin
xshi0057-Dec-04 14:49
xshi0057-Dec-04 14:49 
GeneralRe: Auto-scroll ListView Pin
kostasvel7-Dec-04 2:31
kostasvel7-Dec-04 2:31 
GeneralRe: Auto-scroll ListView Pin
xshi0057-Dec-04 9:06
xshi0057-Dec-04 9:06 

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.