Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Dear Friends,
 
Here i Developed Windows Service.Its Working Fine in Adminstrator Account But when comes to User Logins the Windows Service Getting an Exception.The Exception is cannot open service computer.I have Checked with app manifest file.its working but i dont want to use appmanifest file.Trough Code i want to acess the administrative previlages.So if any Information Regarding this please share with me.
 
foreach (ServiceController scrTemp in scr)
                {
                    if (scrTemp.ServiceName == "DEMIS_MSMS_SERVICE")
                    {
                      
                            flg = 1;
                            scrTemp.Refresh();
                            string str1 = scrTemp.Status.ToString();
                            if (str1 == "Running")
}
}
this is sample code but iam getting an exception cannot open DEMIS_MSMS_SERVICE on your computer
Regards,
 
Sravanthi
Posted 9-Jan-13 0:30am
Edited 9-Jan-13 0:31am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Services also have ACL-s. If you don't want to grant access to all services to a user, you can set up individual service control rights. You can use SetACL[^] for example (from command line or even from an application via i'ts COM interface) to set ACLs on Services.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 424
1 ridoy 410
2 DamithSL 240
3 OriginalGriff 179
4 Suvendu Shekhar Giri 150
0 OriginalGriff 8,033
1 DamithSL 6,179
2 Sergey Alexandrovich Kryukov 5,538
3 Maciej Los 5,508
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100