Hi, Have you tried to impersonate a user with sufficient priviledges (in the thread method), like this?
Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.Impersonate(token)); You can get the "token" by calling the LogonUser API... you can find examples of this if you google for "Thread.CurrentPrinciple" (but you'll have to ask for unmanaged code permissions:( ) HTH, Stoyan Damov -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Julie Sent: 08/26/2003 18:27 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Security Permissions on a new thread (C#) I have a web program that spawns a new thread as follows: Thread t = new Thread(new ThreadStart(ProcessFileThreadOperation)); t.Start(); The thread itself starts a long process where it begins by opening a file, then does alot of processing on this file, and once it is done, it e-mails the resulting file to someone. Now if I remove the thread altogether by changing the previous 2 lines to simply call the function : ProcessFileThreadOperation(); then everything works... but I don't get a separate thread, and hence I have to wait for this process to return before the user can do anything else... But when it is part of a thread, it fails to open the file, I get an error stating that "Error: Logon failure: unknown user name or bad password." as if my credentials were no good on this new thread. This may seem trivial, but I've been researching all over the place to see how I can solve this problem, and nothing has come up... It works fine as long as it is on my computer, but that's probably because my security is a bit more flexible, however once it is loaded at my web host, it no longer works. Any suggestions out there? Thanks, Julie =================================== This list is hosted by DevelopMentor� http://www.develop.com NEW! ASP.NET courses you may be interested in: 2 Days of ASP.NET, 29 Sept 2003, in Redmond http://www.develop.com/courses/2daspdotnet Guerrilla ASP.NET, 13 Oct 2003, in Boston http://www.develop.com/courses/gaspdotnet View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com NEW! ASP.NET courses you may be interested in: 2 Days of ASP.NET, 29 Sept 2003, in Redmond http://www.develop.com/courses/2daspdotnet Guerrilla ASP.NET, 13 Oct 2003, in Boston http://www.develop.com/courses/gaspdotnet View archives and manage your subscription(s) at http://discuss.develop.com
