|
If a user has full admin rights they can take down/kill any process.
At Karpersky it is a windows service that must be shut down(stoped) before ending the process(es).
[edit to add]
If the computer(s) are on a domain with active directory then it would be really simple to block even the local admins.
All the best,
Dan
modified on Sunday, January 16, 2011 12:55 PM
|
|
|
|
|
By hooking into TerminateProcess or NtTerminateProcess you can achieve what you're looking for. I seriously doubt though that having a .NET C# function as a hook function is a.) advisable and/or b.) a feasable thing.
If you want to invest some time/work to get going in C++ this CP articel might come in handy: Easy way to set up global API hooks[^]
Regards
|
|
|
|
|
This question comes up regularly in one form or another in this forum. While I appreciate that you have a legitimate reason for wanting to do this, you have to appreciate that we are averse to posting information that will let any old script kiddy create a malware application that can't be terminated. Sorry.
|
|
|
|
|
Well said. Exactly what I was thinking, but you reflect it in a much more polite manner.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
hey guys..i have a chart control and a datagridview on my form..i want to show the values in a graphic which i have in datagridview..Here is how it looks..i have some questions about it.
1) how i can arrange YAxis increase rate as 1..it increases by 5.
2) how i can move the black lines on backround of my chart area?
3) there are two series(Series 1 and Sayilar) there..i couldnt find any example that i can use Series1..i mean the chart control already has..that is why i created new one(Sayilar)..my question is how i can use Series2 or how i can remove it..here is the codes i created and added it to my chart control
4) how i can add some texts of Chart control Axis to inform the user which columns means what
Series series = new Series("Sayilar");
series.Color = Color.DarkGoldenrod;
series.BackSecondaryColor = Color.OrangeRed;
series.BackGradientStyle = GradientStyle.LeftRight;
series.XValueMember = "Sayilar";
series.XValueType = ChartValueType.String;
series.YValueMembers = "Kaç Kere";
series.YValueType = ChartValueType.String;
series.ChartType = SeriesChartType.Column;
chart1.Series.Add(series);
than ks for your helps and answers
vemedya.com
|
|
|
|
|
I've written a small monitoring app in c# that notifies the user of specific events on the pc. The wish I would like to have is for the one and only control (Label) to be static on top of the task bar. Currently I've just got a timer running that places it as the top most window, I'd like to eliminate the timer and just have it pinned sort of to the taskbar (not in the notify area). Any direction you may provide would be helpful.
|
|
|
|
|
There's a CodeProject-article on creating a DeskBand[^] that might be useful
My last[^] article - write your own FileSystem application in .NET
|
|
|
|
|
Hello,
When i wrote a "Source" property as full path "C:\aaa\aaa\aaa\aa\fileName" i do hear the sound, but when i'm trying to set the path using the resources, it doesn't work (no sound), i've marked build actions of the media file as "resources". and in source i wrote /namespace;component/Resources/filename
What i'm doing wrong here ?
thanks
|
|
|
|
|
I used to play sound file from Resource by using something like given code
SoundPlayer sp = new SoundPlayer(global::WindowsApplication1.Properties.Resources.XYZ);
sp.Play();
I will suggest you to navigate this link[^] to learn simple way of playing Sound file which is embedded in resources.
modified on Sunday, January 16, 2011 12:58 AM
|
|
|
|
|
thanks for the answer. but the problem is , i'm using wpf media element, i cant call global::WindowsApplication1.Properties.Resources.XYZ within media element tag, by using Source Property
|
|
|
|
|
igalep132 wrote: i'm using wpf media element
If so then you should mention about WPF in your Question
|
|
|
|
|
I had to write a function that was essentially "given some random object at RUNTIME as 'object o' and some random property as 'string propertyName' at RUNTIME, return property o.[propertyName] as an object."
First thought was naturally reflection.
for (i = 0; i < 1000000; i++)
{
// get property 1 million times through reflection
}
that took 4.4 seconds on my machine. I unwound the loop a bit and got it down to 2.1 seconds.
Then I switched it over to LINQ expression trees and got it down to 93 MILLSECONDS. 4.4 seconds down to 93 MILLSECONDS...
Now, LINQ expression trees are very poorly documented in MSDN and a search on google and CodeProject turns up very little. It did take me about 5 hours to figure them out (on a super basic level).
But why aren't they used more often? 4.4 seconds vs. 93 millseconds sounds like a big deal to me .
|
|
|
|
|
SledgeHammer01 wrote: But why aren't they used more often? 4.4 seconds vs. 93 millseconds sounds like a big deal to me
Primarily because they are poorly understood, and working with them is more complex than most other areas.
|
|
|
|
|
Hmm... my first reflection version was about 6 lines of code and my final LINQ expression version was also about 6 lines of code.
Reflection is certainly more documented, but its a shame because LINQ expressions seem pretty powerful and they run about 50x faster in my tests.
|
|
|
|
|
Pete O'Hanlon wrote: Primarily because they are poorly understood,
May be, but that won't be the primary reason. Primary reason could be that expression trees can be compiled which gets translated into IL opcodes. This is way faster than reflection looking for a method and invoking it. If the method signature is known at compile time, converting reflection's MethodInfo to a strongly typed delegate will also improve the performance.
Best wishes,
Navaneeth
|
|
|
|
|
I think you misunderstood my response. I was answering the question about why people don't use them more - I'm well aware of the benefits of Expressions.
|
|
|
|
|
My bad, I am sorry.
Best wishes,
Navaneeth
|
|
|
|
|
No problem. Don't worry about it - if you didn't get what I was talking about then I obviously didn't explain it clearly enough. Ergo, the problem was at my end.
|
|
|
|
|
SledgeHammer01 wrote: why aren't they used more often?
SledgeHammer01 wrote: LINQ expression trees are very poorly documented in MSDN
SledgeHammer01 wrote: a search on google and CodeProject turns up very little.
SledgeHammer01 wrote: It did take me about 5 hours to figure them out (on a super basic level).
|
|
|
|
|
It caches, just like your Reflection code should -- getting the same property a million times is where you are wasting your time; rewrite it and then compare.
|
|
|
|
|
Huh? Cache what?
I don't have production code that goes for (int i = 0; i < 1000000; i++) . Its called benchmarking code .
"version 1" didn't cache anything and it took 4.4 seconds to run 1 million times
"version 2" cached the PropertyInfo object and it went down to 2.1 seconds to run 1 million times. I can't cache the propertyInfo.GetValue() call, that would a) defeat the whole point and b) not even work... what if the value changed? How would I get notified in a callback function that it changed? And you want me to cache the values of a million objects? x 2.
"version 3" went to LINQ expression trees and it went down to 93 milliseconds to run 1 million times. I cached the expression tree, but I did NOT cache the "expressiontree.GetValue()" calls. I still get the same property 1 million times.
4.4 seconds (or to be fair 2.1 seconds) vs 93 milliseconds is not because I'm caching anything.
propertyInfo.GetValue() is an expensive call. It gets the getter method and then calls Invoke on it. I suppose I could have gotten the getter method and cached that, but Invoke is still an expensive call.
The expression tree was simply "inline code" that essentially expanded to:
return (object)((SomeType)o).SomeProperty;
Thats a direct call vs. an invoke.
Thats why its tons faster then reflection.
-- Modified Saturday, January 15, 2011 9:23 PM
|
|
|
|
|
Actually, upon looking at it further in Reflector, GetGetMethod() is not expensive at all. Its already cached in the PropertyInfo object. Once you get the PropertyInfo, its already gotten the getter and cached it in a private variable. private RuntimeMethodInfo m_getterMethod; to be exact.
Invoke is very expensive since it doesn't cache a bunch of stuff, validates parameters, checks security, etc.
Expression trees don't do any of that stuff.
|
|
|
|
|
|
|
SledgeHammer01 wrote: for (i = 0; i < 1000000; i++)
{
// get property 1 million times through reflection
}
that took 4.4 seconds on my machine. I unwound the loop a bit and got it down to 2.1 seconds.
How are you making the calls? MethodInfo.Invoke() ? If yes, then this method is slow. Try creating a delegate from MethodInfo using Delegate.CreateDelegate method and use that for invocation. You should get results closer with expression trees. Make sure you don't do delegate creation on each iteration.
Expression trees are faster because they gets translated into IL when you call Compile() on it.
Best wishes,
Navaneeth
|
|
|
|