|
Abhinav S wrote: Copy this code Are you referring to the code in the link posted by Luc ? ... or ... missing link ?
thanks, Bill
"The first principle is that you must not fool yourself, and you are the easiest person to fool." Richard Feynman
|
|
|
|
|
I'm referring to the code that the OP has posted.
|
|
|
|
|
This is quite close to a self-submission to the Hall of Shame. You don't appear to have understood how to do custom painting at all (hint: check out the Paint event), you never read the values out of your 'polygan' (sic) class, you allocate and never dispose of extra graphic objects, you use meaningless names ...
You really need to go away and understand the WinForms graphics model properly. I could give an entire solution but it wouldn't help you actually learn the principles you are so clearly lacking.
|
|
|
|
|
Could u tell me how to get name and count of tables in a MS Access database?
I tried by MSysObjects but i have an error.
Error says that to use administrator account.
But i have used just an administrator account one. Could u tell me any other ways for that matter.
|
|
|
|
|
PiebaldConsultant gave you and Answer yesterday[^]. If you want more help you will need to be more specific:
1) Did you try his suggestion it should work- if not what went wrong
2) How are you accessing MSysObjects (supply code)?
Point 2 is most important as there are several scenarios:
A: You are accessing the table directly in which case you need to be an admin on the database
B: You are accessing via an application
If this is using windows authentication to the database: The account the app is running under needs to be an admin on the database. For a winforms app, it would be running under your account. Web apps are more complicated and you'll need to work out which account is being used.
If this is using an "SQL account" (i.e. you have supplied a username and password)to the database: The account specified needs to be an admin on the database
|
|
|
|
|
There is "SYS" in MSysObjects, no wonder you need a special account when going that route.
Stick with OleDbConnection.GetSchema() as Piebald told you.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
I strongly recommend avoiding database-specific techniques. ADO.net includes interfaces and base classes that make database-agnostic access very easy to accomplish.
|
|
|
|
|
phowarso wrote: Error says that to use administrator account. But i have used just an
administrator account one.
That's not refering to an admin account on the machine. That's refering to the designated administrator account in the database. The two are not the same thing.
Seriously, follow the advice given yesterday. You're trying to do it the hard way.
|
|
|
|
|
I have a mail server used exchange 2003, but most of spam message in queues, i want to get an application used to delete the spam mail from queues, how to do it?
ms Microsoft exchange queue spam
|
|
|
|
|
Stephen T. Charlie wrote: I have a mail server used exchange 2003, but most of spam message in queues, i want to get an application used to delete the spam mail from queues, how to do it?
What do you mean with "want to get an application"?
Since this is a programming forum, first thing that comes to mind is the dev's documentation[^] for Exchange.
It'd probably be best to let Exchange[^] handle the spam itself.
Bastard Programmer from Hell
|
|
|
|
|
Hi, I got a task and I tried many ways to do but I couldn't find out how, I need to make a windows service that will return Access is denied when a user in admin group tries to disable or stop the service. My service's CanStop property is false but when I open msconfig I could disable my service. However Eset Service return access is denied when I try to stop or disable it. Please help me. I want to do this because, we add our workers to administrators group on their computers so they can kill any of our control mechanisms when they want. This service will serve us to control their computers. Thanks.
modified 8-Feb-12 2:25am.
|
|
|
|
|
Just set the security rights of the service to administrator control only.
No other user will be able to restart this service then.
Set this in the installer
e.g.
Account = ServiceAccount.User,
Username = @"domain\username",
|
|
|
|
|
Hi thank you for quick answer but I don't want "Administrator group" to stop or restart the service. Because like I said we add our users to Administrator group.
|
|
|
|
|
candogu wrote: Hi thank you for quick answer but I don't want "Administrator group" to stop or restart the service. Because like I said we add our users to Administrator group.
Can't be done. The person owning and driving the car decides, not the manufacturer. If it's their computer, they are in control of their system.
If they shouldn't be, then they shouldn't be administrators. You can't have both.
Bastard Programmer from Hell
|
|
|
|
|
To extend Eddy's answer, why are you making users Administrators? That's a really dangerous practice, and should be discouraged.
|
|
|
|
|
Because they would add or remove programs when I add them to Users group, they cannot.
|
|
|
|
|
Is this an organisational thing? Most organisations that I know prevent users from adding/removing programs and require central management of applications; which means that the user cannot add "dodgy" applications themselves. If you allow people to pick their own applications, you are opening up a particularly nasty can of worms there.
|
|
|
|
|
Like that, we want users to add or remove programs as they need (want), but we absolutely don't want our application to be stopped disabled, removed or killed from system. Thanks.
|
|
|
|
|
..walks over to the computer and pulls the electrical cord, just because it's possible.
"Now what"?
Bastard Programmer from Hell
|
|
|
|
|
The UPS just kicked in. And in a few hours the Diesel group will start roaring.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
|
Then the same security adice applies. The only problem with doing this is that REAL Admins will no longer be able to control the service either. Only the System would be able to do it and your not going to convince the system to do so.
Talk about the Wild West. Your security environment is so screwed up. You say you've given users Administrator rights just to install software. What you've really done is given users the keys to do ANYTHING AND EVERYTHING, not just install software.
What you've done, out of convenience to the users, has created a giant headache for you. The only REAL way out of this problem is to revoke those admin privs and knock everyone back to Users, except, of course, the REAL admins. Then your group would have to take over clearing software for production use and installing it.
The service does not dictate who is going to stop it and who isn't. That's determined by the ACL (Access Control List, or Security) on the service.
|
|
|
|
|
|
I'd just like to reinforce the answers that say your security policy is broken here. Either you trust your staff, in which case you don't need a monitoring service that they can't kill, or you don't, in which case they shouldn't be admins. You are searching for a technical solution to a HR problem.
The simplest approach here is to make disabling the service a disciplinary offence.
Edit: also, this really isn't a C# question.
|
|
|
|
|
candogu wrote: I need to make a windows service that will return Access is denied when a user
in admin group
To answer another way, Don't, just don't, oh for the love of humanity don't.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|