473,985 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent two users from accessing the same file at the same time

Well, the subject sais it all. What is the best approach to prevent this
from happening?

Thanks,
Shawn
Feb 18 '06 #1
2 1403
Hi Shawn,

You can setting a flag in an ApplicationStat e, e.g.
Application["fileAccess ed"]. In Application_Sta rt set it as false,

Application["fileAccess ed"] = false;

Only when it's false to allow to access and shift it to true and also set a
flag in Session. Once finish accessing the file to shift Application flag to
false and delete Session flag. Or in Session_End to check Session flag,
accordingly shift Application flag.

HTH

Elton Wang
"Shawn" wrote:
Well, the subject sais it all. What is the best approach to prevent this
from happening?

Thanks,
Shawn

Feb 19 '06 #2
you can also use Singleton class.
"Shawn" wrote:
Well, the subject sais it all. What is the best approach to prevent this
from happening?

Thanks,
Shawn

Feb 19 '06 #3

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

Similar topics

7
7334
by: Douglas | last post by:
I have a frontend and backend database , program.mde and data.mdb on a client PC. How do i prevent them launching the program.mde more than once on a single PC? Somtimes they minizmise the program and dont see it and startup an new copy. At a later stage I want this database to be multiuser, on a network , so i dont want to limit the database to one user only, just one program lauch per PC
8
4868
by: Smartin | last post by:
I have a form in Access97 which facilitates a query against a production Access database. Users will enter some search terms and see a datasheet view of the results in a subform. The prod table is linked (the form is not included in the production mdb file). I need to ensure that an unexperienced user will not accidentally change the prod table. What measures should I take? So far I have done the following: In the subform, set Allow...
16
6300
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
3
2055
by: Phil | last post by:
Jerry posed some good ideas, a while back, on website a security issue that comes up often. Gary Jones was asking how to keep users from directly accessing php pages, out of sequence. Jerry posed a directory management solution. No one seems to have mentioned an alternative. Maybe there is a reason? We took a different approach, noting that the only way we wanted a user to enter some phps would be through a predefined series of steps...
0
10377
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
11632
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7644
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6594
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5186
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.