473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Locking Files

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

Nov 21 '05 #1
2 2056
On 13 Sep 2004 20:02:34 GMT, Joecx wrote:
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
--
Tom Shelton [MVP]
Nov 21 '05 #2
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
From: Tom Shelton to*@YOUKNOWTHEDRILLmtogden.com
Date: 9/14/2004 12:26 AM Central Standard Time
Message-id: <1c*****************************@40tude.net>

On 13 Sep 2004 20:02:34 GMT, Joecx wrote:
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
--
Tom Shelton [MVP]

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Geoffrey | last post by:
We have developed a python class that can read data files created from another application. These target files are C-ISAM files used for accounting applications so the "primary" application may be...
4
by: Sam | last post by:
Hello everyone, I have around 20 reports in an ASP web-application which connects to a SQL Server 2000 dB, executes stored procedures based on input parameters and returns the data in a nice...
3
by: Wolfgang Bachmann | last post by:
We migrated a database from Version 5.1 to 8.1 and are experiencing massive locking problems. We migrated in the following steps: 0) Server 5.2, Clients 5.2: everithing was fine 1) Server 5.2,...
15
by: z. f. | last post by:
Hi, i have an ASP.NET project that is using a (Class Library Project) VB.NET DLL. for some reason after running some pages on the web server, and trying to compile the Class Library DLL, it...
0
by: alex | last post by:
I have few web pages that allow to upload, delete, etc images (.jpg, ..bmp, .gif) Once the page is doen working with file thru Bitmap class I close file handles as: Bitmap bmp = new...
5
by: Adrian | last post by:
Is there a way to lock records and/or files in multi user application, using C#? Adrian.
4
by: John please don't spam me! | last post by:
VB.Net 2003 Hi, 2 questions: 1. I want to read a file in without locking it, as it is Log file. 2. I want to be able to read from the last point it wa read upto. The project is: Search...
15
by: Matt Brandt | last post by:
I am trying to get multiple threads to lock specific regions of a file. However, since each thread has the same PID, it appears that a lock by one thread does not block another thread from the same...
7
dlite922
by: dlite922 | last post by:
I need to do some sort of Locking mechanism at interface level, instead of DB Level. I know how MySQL table locking works, but that won't work in my scenerio. Requirements: When someone is...
3
by: HugoVallejo | last post by:
Hi everyone. I've created an ASP.NET web site which uses a .NET assembly to read/write operations using an odbc driver. When a connection to the odbc database is made locking files are created, when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.