Error accessing '\Documents and Settings\default.vol' file ?



I am trying to create a backup software for smart device application and I
want to copy contents of selected files, using Visual Studio 2008 and .Net
Compact Framework.

I am trying to open "\Documents and Settings\default.vol" file using
following code.

Dim path as String="\Documents and Settings\default.vol"

Dim fs As FileStream

fs = New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)

But I am getting error:-

"System.IO.IOException was unhandled
Message="The process can not access the file '\Documents and
Settings\default.vol' because it is being used by another process."
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share) at SmartBackup.Form1.ProcessFile(String path) at
SmartBackup.Form1.ProcessDirectory(String targetDirectory) at
SmartBackup.Form1.Button1_Click(Object sender, EventArgs e) at
System.Windows.Forms.Control.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnClick(EventArgs e) at
System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32
lParam) at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) at
System.Windows.Forms.Application.Run(Form fm) at SmartBackup.Form1.Main()
InnerException:

Any idea how can I read such files ?

Best Regards,

Luqman







.