This question already has an answer here:
How to prevent users from killing C# Application [closed]
(1 answer)
Closed 9 years ago.
I have an application cafe timer. I want my application process not to end by task manager from users. Thanks
You need to run it as a Windows service with elevated credentials so that users have insufficient rights to end it.
You could bullet proof this by having your service auto restart on shutdown, and regularly saving some state into a data file so that you can carry on in case your service ever does get terminated.
Related
This question already has answers here:
Can't set up the HMR: stuck with "Waiting for update signal from WDS..." in console
(9 answers)
Closed 3 years ago.
Good afternoon,
I have been trying to create a react app by following this tutorial:
https://www.youtube.com/watch?v=Ke90Tje7VS0
The issue is, I can't seem to connect to the dev server. The page comes up and works fine, but I can't update anything. When I open the console on the server, all I see is "[HMR] Waiting for update signal from WDS..." Does anyone have any idea how I can fix this so I can get on with the tutorial?
Thanks in advance!
There is an ongoing issue github react link
Check some of the solutions from this link.
This question already has answers here:
Multi-threading in VBA
(8 answers)
Closed 6 years ago.
How can you switch between processes based on time?
++++
I have an Excel macro sending XML requests to Google, it has 3 important processes.
The process sending the XML requests. This process is limited to 10 requests per second.
A loading bar with the ability to quit the program
The Excel Application itself (it should be editable while the program is running)
The macro is currently using the sleep function (from kernel32.dll) to delay the processes, and the DoEvents function to make sure both process are run (and so the application can be modified in the background).
Ex. Process 1
Do While True
Call doSomething
DoEvents 'handles processes 2 and 3
Sleep 100
Loop
This method delays the entire application. Editing the Excel Worksheet in the background is laggy because of the 100ms delay, and attempting to quit the program is also delayed.
To remove this lag, I would like processes 2 and 3 to be running and switch control to process 1 when it is time to send a request. After the request is sent, process 1 can give control of the program back to processes 2 and 3. Does anyone have a solution to this?
Bonus: VBA seems to have little capability for multi threading/processing, but if anyone can think of a way to run all these processes at once I'd love to know about it
The implementation details are quite involved for each of the things you are looking for but they can be easily found by searching. So I'll suggest an approach for each of your questions.
Use Application.OnTime to trigger a macro to run after a given time interval.
Multiple threads can be executed, but it's tricky. You'll need to either
Invoke another instance of Excel and make it run your Macro, that way your main thread is not affected or
Put your macro into a separate text file (vb-script file) and call get it executed via Shell. That way you can continue executing the existing Macro and the user regains control of the UI, but the script fetches new data in the background.
Execute part of your code in a separate instance of Excel and then pump in the results into your current spreadsheet via DDE (older but fairly reliable technology) or by building something called an RTD server.
Ample examples of each of the above points are available on this site and elsewhere through Google.
This question already has answers here:
Don't lock files of application while running
(4 answers)
Closed 9 years ago.
I created a small application which users launch through a desktop shortcut pointing to a network share. Whenever I recompile the app and want to move it to the network share to make it available, it is always locked by many users who are using it, understandably. What I don't get is that I can close all the handles (net file 1234 /close) and the users are unaffected, i.e. they can still work on the app. I then copy the new file and ask them to restart.
Is there a way to "cut off" programmatically the users from the network exe file once they have launched it, so that I don't have to manually close all of the handles every the time?
They'll be affected but the way the jitter works indeed makes it a bit unlikely that their program will crash. Crashes are likely when you use Reflection in your code or the user's machine is under memory pressure from other processes and the program executes code that has not been jitted. YMMV.
The proper deployment choice here is ClickOnce. That creates a local copy of the program on the user's machine. And it automatically sees your update when they restart.
A possible band-aid is renaming the executable. Which works because Windows puts a lock on the file content, not the directory entry. Which lets you copy the update with the same name. Any user that restarts the app will now get the new version. You'll eventually be able to delete the renamed file. But do favor ClickOnce first.
This question already has answers here:
sharpsvn logmessage edit sharpsvn?
(2 answers)
Closed 6 years ago.
I have made an program that works can read out TortoiseSVN commits and shows it into listbox and a textbox.
Now I have to do this, when you press publish button then for each selected commit the logmessage needs to add [PUBLISH].
How do I update an commit and send it back to the database, in a VB script using Subversion and sharpSVN
This is similar to another question in which someone asked about the possibility of changing commit details directly on the repository server through SharpSvn.
Basically, the answer is you can't (sorry), though if you have admin access on the repo, you can do it yourself.
What are the risks of running an exe on an sql trigger? This is a closed server, intranet only, with limited user access to the server where the script runs from and the SQL server connection.
I store outgoing emails temporarily in a table in my database system. These are then sent out via a trigger that runs and exe. The exe simply pulls the to, from, subject, cc, and body from the DB and send the email via CDO.
I have to use an outside method of sending emails instead of simply sending from code-behind in order to avoid slwodown on the website. I asked regarding this specific issue in another post, but asking about exec risks seemed like a seperate issue. Direct any alternatives to the related post.
Related post Email from web without tying up webpage
If it's a closed server and the .exe is known, I don't see that there would be much risk if any. The only risk I could see would be if someone changed your exe for something else that would then be triggered, but that seems unlikely given the scenario you described.
We had a similar situation several years ago where we had a vendor whose product was updated via a control program. We had a trigger that hit the control program each time a user was added to the sql database, and the control program would then signal its service to add the user there as well. Never had a real problem with it.