|
That's not how this forum works. Somebody posts a vague question that requires some research. It's up to you to go off, read up on the subject, write a lengthy reply detailing exactly how to accomplish the task and the ins and outs of the topic. Expecting somebody to Google a topic first is just crazy talk.
|
|
|
|
|
thanks for your valuable advice.
|
|
|
|
|
I'm not altogether convinced that your irony got through there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Neither am I. I hope that he's being subtle and not taking it to heart.
|
|
|
|
|
Hi friends,
I am developing a Parental Control application. I want that no body could kill this application from Task-Manager. Even administrator should not be allowed to kill this process from Task-Manager.
The only way to close the application should be that user click its CLOSE button, he will be then asked to enter his password, and if he enters correct password, application would get closed.
The behavior should be similar to when user try to kill an anti-virus. For example when I try to kill the anti-virus Kaspersky, I get below error message:
---------------------------
Unable to Terminate Process
---------------------------
The operation could not be completed.
Access is denied.
I also want similar behavior. Please let me know, how to do that.
Thanks in advance
|
|
|
|
|
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.
|
|
|
|