Results 1 to 10 of 10

Thread: Why does my file get locked?!

Threaded View

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Question Why does my file get locked?!

    I am simply reading from a textfile, but it gets locked (cant write on it), until I close my program:
    VB Code:
    1. Dim sr As StreamReader = File.OpenText(strFullPath)
    2.             Dim strLine As String
    3.  
    4.             Do
    5.                 strLine = sr.ReadLine()
    6.                 If strLine = Nothing Then
    7.                     Exit Do
    8.                 End If
    9.  
    10.                 ' Some other code here ... :P
    11.             Loop
    12.             sr.Close()

    I'm closing the streamReader, but still the file is locked. I tried to do grabage collecting too, but that doesn't work.
    Someone help plz
    Last edited by MrPolite; May 8th, 2002 at 12:02 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width