Locking Files

  • Thread starter Thread starter Joecx
  • Start date Start date
J

Joecx

Hi
I am trying to understand what the lock feature does in vb.net.
I am using a text file.

I have created an instance of the filestream using fs and I am using the
following line:

fs.lock(0, fs.length)

When I set this up using the function instead of name spaces, it locks me out
of bring it up in notepad (which is the desired result).

But when I use the fs.lock method, it doesn't seem to accomplish anything.

Can someone explain what the .net lock feature is suppose to do and maybe would
you have some sample code I could see to make sure I am using it correctly?

Thanx if anyone can help!!!!!

Joe
 
Hi
I am trying to understand what the lock feature does in vb.net.
I am using a text file.

I have created an instance of the filestream using fs and I am using the
following line:

fs.lock(0, fs.length)

When I set this up using the function instead of name spaces, it locks me out
of bring it up in notepad (which is the desired result).

But when I use the fs.lock method, it doesn't seem to accomplish anything.

Can someone explain what the .net lock feature is suppose to do and maybe would
you have some sample code I could see to make sure I am using it correctly?

Thanx if anyone can help!!!!!

Joe

Joe,

I'm a little unclear here - and maybe are others... Can you give some
example code and be a little more concise as to what your issue/question
is?

Thanks
 
Thanks for responding........basically I am trying to figure out how to use the
namespace lock feature of dot.net.

I want to lock a text file while modifying it during the run of a program and
then unlock it after I finish modifying it. I don't even want someone to be
able to read it in a text editor during that time. I hope this clarifies what
I am trying to do.

Thanks again!
Joe>Subject: Re: Locking Files
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top