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

Problem with service and blocked txt o_O

Hi!
I wrote a windows service, this service read a txt file and make some
task... the service works at 00:00, 00:30, 01:00, 01:30 etc... (every
half hour)

The problem is the txt, there is a dataloger that writes on it every 10
minutes, the dataloger and the service dont run at the same time, i.e:
Service: 00:00, 00:30, 01:00, 01:30 etc...
Dataloger: 00:05, 00:15, 00:25, 00:35 etc...

This works fine 3 or 4 times and then the dataloger crash with an I/O
error, can't write the txt file because the service had it blocked...
and i dont know what the hell is blocked the txt, i close the reader,
set it to nothing, call .finalize and

Try
srLector = New StreamReader(_File)
Catch ex As System.IO.IOException
EventLog1.WriteEntry("Error: " & ex.ToString)
End Try
..
..
srLector.DiscardBufferedData()
srLector.BaseStream.Close()
srLector.Close()
srLector = Nothing
..
..
Me.Finalize() ' when all the work is done...

I even try to copy the file and work with the copy but it crashes the
same way...
I know the problem is with the service, because it happens even when
the dataloger is not running, so PLEASE! if anyone knows what happend
write me a letter

Thanks in advance...
Jes

Nov 23 '05 #1
1 931
Do you write to the file? If not, make sure you open the file and
don't lock it. Then the other program can access it.

Nov 23 '05 #2

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

Similar topics

5
by: krisk | last post by:
Could not find ansewr: in ProjectInstaller, RunInstallerAttribute: ..... this.serviceInstaller1.ServiceName = MyServiceName; in the code: public class MyService :...
3
by: Blitz Krieg | last post by:
Oh Great Gurus... The wisdom of DotNet-dom is needed... We have several applications in our test lab, that do not need peak performance, but consistent reporting. We have been using C# and VB...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
7
by: jonathan | last post by:
I installed service pack 2. Sometimes I saw a link that link to: <a href="javascript:popChatWin(0)"> Sometimes I use javascript to redirect website. Service pack 2 block that. Sometimes the...
0
by: Jonathan Trevor | last post by:
Hi, I've found what appears to be a bug with ASP.NET web service method invocation - making it impossible to invoke and get the result of a synchronous web call after an asynchronous call has...
1
by: abhra.haldar | last post by:
Hi: I have an ASP.NET page which makes a synchronous Web services method call. At the same time, however, I wanted it to load another page as an iFrame (i've also tried as a javascript popup...
81
by: =?utf-8?B?4piG4piG4piG4piG4piGIFPDvCBLZWl0aCBDaGFr | last post by:
Installed this compiler on Vista; a simple "hello world" after compiled and run would pop-up a window "source file not compiled" I've seen this question asked a few times on Internet groups and...
1
by: DaveL | last post by:
Hello, hope u can help or point me in the right direction I have 2 Services on our production System 1 Service is Vb6 (not the problem) 2 nd service is on another maching c# (not the problem) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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,...

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.