PC Review


Reply
Thread Tools Rate Thread

asp.net and permissions

 
 
Stephen Witter
Guest
Posts: n/a
 
      26th May 2004
I am trying to copy a file to a network drive. I can do it on the
domain controller/web server but not from a client. Here is the code:

Dim impersonationContext As
System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As
System.Security.Principal.WindowsIdentity
currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
'response.write(User.Identity.Name)
'response.end
dim Temp as string="TestFile"
File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &
".doc")

impersonationContext.Undo()

With or without impersonation I am getting errors, but it works fine,
as I said, on the domain controller. How do I specify a specific
individual when executing this code?
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      27th May 2004
Hi Stephen,

Did you try this already in the newsgroup

microsoft.public.dotnet.security

Maybe you can find your answer there

Cor

> I am trying to copy a file to a network drive. I can do it on the
> domain controller/web server but not from a client. Here is the code:
>
> Dim impersonationContext As
> System.Security.Principal.WindowsImpersonationContext
> Dim currentWindowsIdentity As
> System.Security.Principal.WindowsIdentity
> currentWindowsIdentity = CType(User.Identity,
> System.Security.Principal.WindowsIdentity)
> impersonationContext = currentWindowsIdentity.Impersonate()
> 'response.write(User.Identity.Name)
> 'response.end
> dim Temp as string="TestFile"
> File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &
> ".doc")
>
> impersonationContext.Undo()
>
> With or without impersonation I am getting errors, but it works fine,
> as I said, on the domain controller. How do I specify a specific
> individual when executing this code?



 
Reply With Quote
 
Stephen Witter
Guest
Posts: n/a
 
      27th May 2004
I searched everywhere on the web and MSDN. I should be more specific
on the error. The error is "System.IO.FileNotFoundException: Could
not find file \\Server\File" and it occurs on the file copy statement
when run from a [authenticated] client's browser. The file.copy
statement is trying to copy a file on a different server than the web
server.

"Cor Ligthert" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> Hi Stephen,
>
> Did you try this already in the newsgroup
>
> microsoft.public.dotnet.security
>
> Maybe you can find your answer there
>
> Cor
>
> > I am trying to copy a file to a network drive. I can do it on the
> > domain controller/web server but not from a client. Here is the code:
> >
> > Dim impersonationContext As
> > System.Security.Principal.WindowsImpersonationContext
> > Dim currentWindowsIdentity As
> > System.Security.Principal.WindowsIdentity
> > currentWindowsIdentity = CType(User.Identity,
> > System.Security.Principal.WindowsIdentity)
> > impersonationContext = currentWindowsIdentity.Impersonate()
> > 'response.write(User.Identity.Name)
> > 'response.end
> > dim Temp as string="TestFile"
> > File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &
> > ".doc")
> >
> > impersonationContext.Undo()
> >
> > With or without impersonation I am getting errors, but it works fine,
> > as I said, on the domain controller. How do I specify a specific
> > individual when executing this code?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
In-depth documenation on User Permissions, Group Permissions, ACLs, DCLs etc. Curt K Microsoft ASP .NET 0 3rd Nov 2006 04:54 PM
Files without inherited permissions always deletable despite object specific permissions? WakA Microsoft Windows 2000 Security 10 12th Mar 2005 02:14 AM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle Microsoft ASP .NET 0 11th Aug 2004 03:04 PM
problems relating to Client Permissions - NT Security Descriptor vs. MAPI Permissions in Exchange 2003 Bill Nguyen Microsoft Outlook 0 3rd Aug 2004 10:02 PM
Windows 2003 - Share Permissions & Security Permissions =?Utf-8?B?U25haWw=?= Microsoft Windows 2000 Security 1 24th Mar 2004 02:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 AM.