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

Home Posts Topics Members FAQ

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 1779
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*******@disc ussions.microso ft.com> wrote in message
news:CF******** *************** ***********@mic rosoft.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
3930
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 them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
5
5469
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. I want to develop a webpage where people can send attachments that are stored on their local PC.
1
2028
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 from fcntl import * class Log(object): """
1
1283
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 time parameters for runtime. I can handle those licencing issue in the following way. 1 From my application, the end user press a button and is able to send a mail to my company wich contain its system MAC adress,Machine NEtbios name and licence...
0
1301
by: chris | last post by:
Cell Phone Repair & Unlocking Service, Fast Turn-Around & Great Prices! The Cell Shop http://www.cellphonerepair.org
2
3754
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 another picture. When running, he says the file is in use when I want to overwrite it.
1
251
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 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...
0
1062
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 document is available? If anybody knows please help me it's urgent. Thanks in Advance Regards,
3
5596
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 the mutex in order to activate the thread once the data is generated. I have to do it this way, i can only call the thread if the data are generated. ******************************************************** step 1: initialize the mutex
0
9669
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...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10155
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
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
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
5431
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
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
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

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.