|
You can use ProcMon[^] to watch the file operations of your service.
|
|
|
|
|
It is difficult to say anything without seeing your code. It depends on how your code resolves the path.
Program Files folder is generally not accessible to programs and services, you'd have to write log files to User Profile Directory which is usually C:\Users\<username>\AppData.
Shameel,
http://thedeveloperspace.com
|
|
|
|
|
Search for the file name / mod dates on the drive and / or in program data or user data.
Have a coffee and let it search.
(Check the Windows / custom app "event" logs).
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Hi Experts
Situation:
As soon I instantiate a class which implements IDisposable as a member in one of my own classes I make my class also IDisposable ; this e.g. in case I instanciate AutoResetEvent or any other synchronization stuff.
My colleagues argue I'm too nitpicking.
So my simple question: Am I to nitpicking in this case?
Btw: I break my rule in case I instantiate e.g. Font
Thank you very much in advance for your comments.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
If your class owns a disposable resource, then it should implement IDisposable . That's not nit-picking; that's just good hygiene.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you very much
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Sorry to disturb again...
In connection with IDisposable: Should I ever take an attempt to have something like try catch/ finally in protected virtual void Dispose(bool disposing) or is it better to take it as the final destaster if an exception happens in Dispose of "my" owned properties?
My opinion: If something strange happens at this low level I do not need to try (I'm anyway not able to) to solve it.
Thank you very much in advance.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I generally avoid it. The Dispose method isn't supposed to throw manageable exceptions, so if you're just calling Dispose on other managed objects, you shouldn't need to worry about it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Great again, thank you so much.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I would at least log it, and figure out why.
The implication is, if it was a "file resource", the file was not closed properly, and so forth.
Ignoring "end of job" problems is not a "thoughtful" solution.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Quote: I would at least log it
Yep, not a bad idea. Nevertheless it is very low level and I think at this level it is ok also to fail without a log.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
On the other hand, a memory leak can bite you days+ later.
That's the poster child for IDisposable.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
You are right, I need to change my mind
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I'm lazy, so... Please, read this very interesting CP article: Implementing IDisposable and the Dispose Pattern Properly
There you'll find final conclusion:
Quote: As you can see, there are a lot of details involved in properly implementing IDisposable and the Dispose Pattern. However, by following the proper template and rules, you can ensure that your disposable objects are handled correctly and behave as first-class citizens in the garbage collection process.
But Eric Lippert in this article: When everything you know is wrong, part one | Fabulous adventures in coding has got another one:
Quote: I’ve written a lot about the perils of C# finalizers / destructors (either name is fine) over the years...
... here are a bunch of things that many people believe about finalizers, all of which are wrong.
...
All of the myths so far imply that if you have code that absolutely, positively must run because it has some important real-world impact then a finalizer is not your best choice. Finalizers are not guaranteed to run.
|
|
|
|
|
Hello Maciej
Indeed a very interesting read. Thank you very much.
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
My opinion is that you write the code that needs to be written. If your object includes another object that is disposable, it only makes sense to inherit from and implement IDisposable for your code object.
It's kind similar to the C++ new/delete idea.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hello,
I have multiple clients, each one of them running windows service, How can I connect to that windows service and pass data to it ?
I'm using signalR so I will pass the data from it's HUB
Thanks in advance
JusT LeT YouR MinD WorK
|
|
|
|
|
The service needs to provide a useable interface that allows you to communicate with it. Most listen on a specific port for specifically formatted commands to be sent to it over TCP/IP. You can host something like WCF inside your service to make things simpler.
|
|
|
|
|
Quote: I'm using signalR so I will pass the data from it's HUB Since you are using SignalR, you do not require to connect to the Windows Service at all, just connect to the SignalR and let it do the work for you. Chances are you are using ASP.NET based SignalR (not the latest Core technologies), then you would have a good integration with Windows Service as well as the underlying system.
Just make sure each of those machines are connected to the SignalR, so that there can a communication relay.
Check this out for more on the topic, SignalR with Self-hosted Windows Service
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I thought the same but if I kept the client (Windows Service) connected to the signalR hub how can I receive the message ? since I don't have any page or GUI
JusT LeT YouR MinD WorK
|
|
|
|
|
Quote: how can I receive the message ? You will receive the message, you will just not see the message. That is the basic concept of a Windows Service. They are UI-less, because of their design.
If you want to see the message in real-time, then either use a UI-based framework, or consider reading the messages from an external source, such as a Queue that processes the messages as they come.
Queuing Windows Services work items using MSMQ, and live progress using WCF Net Named Pipe
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hi I have a MS Database called Holidays with 2 tables called: Destination and Booking.
I have a web form consisting of:
GridView Displaying the data from Destination Table
Label (Text = Holiday ID) with a TextBox (name = txtHolidayID)
Label (Text = Your Name) with a TextBox (name = txtName)
Label (Text = "") and (Name = lblMessage)
Button (Text = Book) and (Name = btnBook)
When the User clicks the Book Button the Web form should check whether the txtHolidyID (In this case 1 - 4) is one of the Holiday IDs in the GridView(Destination Table), If not the lblMessage should display saying "Invalid ID" and not save the Data.
When the User clicks the Book Button and the txtHolidayID is correct (Meaning 1 - 4 in this case), and the txtName is of string, then the holidayID in the TextBox which is from the Destination Table should be saved in the Booking Table along with the Name provided and the lblMessage should display "Booking Successful".
When the User clicks the Book Button and everything is correct but did not save for some reason the lblMessage should display "Booking Failed".
I have searched the forum for something similar but I'm not finding it.
I will add Captures of my Database and Web Form to make things easier to understand.
Sorry for this rookie question.
Database Capture
Shared album - Dreyer Vorster - Google Photos[^]
Destination Table Capture
Shared album - Dreyer Vorster - Google Photos[^]
Booking Table Capture
Shared album - Dreyer Vorster - Google Photos[^]
WebForm Capture
Shared album - Dreyer Vorster - Google Photos[^]
WebForm with Details Capture
Shared album - Dreyer Vorster - Google Photos[^]
|
|
|
|
|
You are telling us what you want to do, makes it look like you want us to do the work for you. If you have no idea then you should get a book or some tutorials and work through them until you are at lease familiar with reading and writing to a database (I suggest any database but MS Access).
When you have a specific problem with the development then you will have a question we can help with.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I have a Study Guide which I can email to you to show that the info I need is not in there. Sorry for the bother. Will dlt the post.
|
|
|
|
|
You need to write a validator for the click event.
Then just assume that the database write was successful.
Say you have a form with 2 textboxes and a button called "Book", then you would add a validator to validate the form first before sending the data to the database.
I've never used GridView because I don't care for it, but I'm sure you can google "GridView Validators" for better help.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|