A
Anthony Lopez
I have an application that is working in WindowsXP and Windows2000 server. I
recently moved it onto a new Windows2003 Server Service Pack 2 machine. It
is now getting an error message which reads "The process cannot access the
file <filename> because it is being used by another process"
this is what I have (abreviated version):
If File.Exist(FullPathName) Then
Dim sr As StreamReader = File.OpenText(FullPathName)
Dim sw As StreamWriter = File.CreateText(NewFullPathName)
... do some work
sw.Flush()
sw.Close()
sr.Close()
File.Delete(FullPathName)
File.Move(NewFullPathName, FullPathName)
End If
I want to be brief, but I have posted this to two other .Net Newsgroups and
they keep attempting to answer the wrong question. So in an effort to short
cut this I am using .Net 1.1 and the help indicates that close() method for
StreamReader/StreamWriter calls .dispose(True)
And that since I am using VB I can not use the "using" C# keyword.
Again what I am looking for is the difference between XP/2K versus 2003
Server and how I can fix this.
recently moved it onto a new Windows2003 Server Service Pack 2 machine. It
is now getting an error message which reads "The process cannot access the
file <filename> because it is being used by another process"
this is what I have (abreviated version):
If File.Exist(FullPathName) Then
Dim sr As StreamReader = File.OpenText(FullPathName)
Dim sw As StreamWriter = File.CreateText(NewFullPathName)
... do some work
sw.Flush()
sw.Close()
sr.Close()
File.Delete(FullPathName)
File.Move(NewFullPathName, FullPathName)
End If
I want to be brief, but I have posted this to two other .Net Newsgroups and
they keep attempting to answer the wrong question. So in an effort to short
cut this I am using .Net 1.1 and the help indicates that close() method for
StreamReader/StreamWriter calls .dispose(True)
And that since I am using VB I can not use the "using" C# keyword.
Again what I am looking for is the difference between XP/2K versus 2003
Server and how I can fix this.