472,984 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

unauthorizedaccessexception

hi, I have a problem making window service.
My service tries to access local files and network files. when I let it
strated, unauthorizedaccessexception is occurred!
I guess my window service do not have domain authorization.
how can I endow my service with domain authorization ?
help me plz..

Jun 27 '08 #1
3 1331
how can I endow my service with domain authorization ?

What account is it running as? Local Service? Network Service?

Local Service will be "anon" when calling out. Network Service will
identify using the machine's identity. If you want a specific account,
then just change the service details to use a named network account (and
restart it). You can automate this if you create an installer (msi) for
the service, but if it is only going to be installed a few times it is
just as easy to go into the services applet and change the settings there.

Marc
Jun 27 '08 #2
Thanks Marc.
I modified property of service process installer as your reply.
So, my service got domain authorization.
//processInstaller.Account = ServiceAccount.NetworkService;
processInstaller.Account = ServiceAccount.User;
processInstaller.Username = "sean";
processInstaller.Password = "fdsfdsfdsf";
"Marc Gravell" <ma**********@gmail.com´ÔÀÌ ´ÙÀ½ ¸Þ½ÃÁö¸¦ ÀÛ¼ºÇß½À´Ï´Ù.
news:u9**************@TK2MSFTNGP04.phx.gbl...
>how can I endow my service with domain authorization ?

What account is it running as? Local Service? Network Service?

Local Service will be "anon" when calling out. Network Service will
identify using the machine's identity. If you want a specific account,
then just change the service details to use a named network account (and
restart it). You can automate this if you create an installer (msi) for
the service, but if it is only going to be installed a few times it is
just as easy to go into the services applet and change the settings there.

Marc
Jun 27 '08 #3
Just remember that it is trivial to disassemble .NET code and look at
the original source... be careful you don't compromise your password by
including it in code.

Marc
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Doug Taylor | last post by:
Hi, I originally posted this in dotnet.security, but have moved it here by request: Hi, I am trying to programmatically add a user with read permissions to the DACL of a registry key. ...
1
by: Hal 9000 | last post by:
In c# we have a function that creates a virtual directory in IIS 6.0 using DirectoryServices API. The code looks like this: // log in to IIS DirectoryEntry rootDir = new...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
0
by: nime | last post by:
I've got a problem. I cannot debug my app. which one contains WebBrowser control. I found a resolution but it's for an ASP related problem. I couldn't find a correct "user" to give permisson then...
8
by: imukai | last post by:
I have a forms-based authentication application on our intranet - ASP.NET 3.5 (C#). For security purposes there is one specific .aspx file that we have enabled Integrated Windows Authentication...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.