473,414 Members | 1,667 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,414 software developers and data experts.

Unlocking a file

Hello

I have searched high and low for the answer to my question. I expect that it is right under my nose but it has come time for me to ask anyway. Is there a way to force access to a file on a computer that has been locked by a VB.NET program that is running on another computer

I have a multiuser environment where common data files are stored on a shared server and each program is run separately from each machine. The actual situation is where one system locks a file on the server and for some reason I want to manually release all locks on the files that that system has but from a different computer. I know that I cannot simply use a handle because the second system does not have that handle in memory. I am coding in VB.NET and have checked out the FileStream class as well as others and cannot find anything that will force access into a file

Any help would be greatly appreciated
Thank You
CoolFire
Jul 21 '05 #1
1 1755
It's not easy to do this. You need to muck around with privileges and such.

I found a sample, but it's in C++:

http://www.codeguru.com/Cpp/W-P/file...icle.php/c1287

Maybe you can port it to managed code.

--
Klaus H. Probst, MVP
http://www.vbbox.com/
"CoolFire" <an*******@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Hello,

I have searched high and low for the answer to my question. I expect that it is right under my nose but it has come time for me to ask anyway. Is
there a way to force access to a file on a computer that has been locked by
a VB.NET program that is running on another computer?
I have a multiuser environment where common data files are stored on a shared server and each program is run separately from each machine. The
actual situation is where one system locks a file on the server and for some
reason I want to manually release all locks on the files that that system
has but from a different computer. I know that I cannot simply use a handle
because the second system does not have that handle in memory. I am coding
in VB.NET and have checked out the FileStream class as well as others and
cannot find anything that will force access into a file.
Any help would be greatly appreciated.
Thank You,
CoolFire

Jul 21 '05 #2

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
1
by: schwerdy | last post by:
Hello developers! I'm using Python 2.3.4 under debian Sarge and want to write a small logger class. My source code reads: #*************************************************** import sys, time...
1
by: serge calderara | last post by:
Dear all, For my application I need to handle licencing as every software. For that I have a demo licence and a runtime licence which can expired after 30 days for the demo and base on a date...
0
by: chris | last post by:
Cell Phone Repair & Unlocking Service, Fast Turn-Around & Great Prices! The Cell Shop http://www.cellphonerepair.org
2
by: Mark | last post by:
Hello, Say I write a picture file to: 'c:\test.jpg' Then I assign this picture to a picturebox PbFoto.Image = Image.Fromfile("c:\test.jpg") Next I want the overrwrite the file test.jpg with...
1
by: CoolFire | last post by:
Hello I have searched high and low for the answer to my question. I expect that it is right under my nose but it has come time for me to ask anyway. Is there a way to force access to a file on a...
0
by: jigar | last post by:
Hello, I want to know that is it possible to access the windows locking and unlocking (Ctl+Alt+Del) functionality from VC++ System programming . If possible then how? Is there any API or help...
3
by: NaeiKinDus | last post by:
Hello, i'm trying to program a thread that would be locked (by a mutex) and that would only be unlocked once that a function (generating data) is done. The purpose is to generate data, and unlock...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.