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.WindowsImpersonationCont ext
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? 2 2270
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.WindowsImpersonationCont ext 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?
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" <no**********@planet.nl> wrote in message news:<#O**************@TK2MSFTNGP09.phx.gbl>... 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.WindowsImpersonationCont ext 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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kim Lots |
last post by:
Hi
Sorry to disturb you again but i really like to know
what's the NTFS folder permissions on a "virtual directory" folder
for a public webserver iis 5.x running ASP 3.0 with an Access DB on a...
|
by: Brad H McCollum |
last post by:
I'm writing an application using VB 6.0 as the front-end GUI, and the
MSDE version of SQL Server as the back-end (it's a program for a
really small # of users --- less then 3-4).
I'm trying to...
|
by: !!! Klutzo !!! |
last post by:
I give permissions for ASPNET on a top level subdirectory.
A windows program copies a file into the subdirectory, however, my web
service cannot access the file because it does not have...
|
by: Jozef |
last post by:
Hello,
Is there a way to change table permissions in VB Code? I can't seem to find
much that's concise in the help file. Here's the situation;
I have a table in the "data" portion of a split...
|
by: none |
last post by:
Hello:
I had a nice php application running on my server here at home, and I
uploaded it to a shared public type server and it started to break all
over the place. It turns out that some...
|
by: MLH |
last post by:
Invalid qualifier error displays at compile time on this A97 example
from Permissions Property HELP. What's wrong with the strContainerName
assignment line? (6th line)
Sub...
|
by: Curt K |
last post by:
We run some web services (IIS 5 and IIS 6) that communicate to a COM out of
process server, which in turn communicates to another out of process COM
server (long story). We have had lots of...
|
by: jporter188 |
last post by:
Hello,
I am working on a project to manipulate XML files. All of the files,
the code, and the output are on network drives. When I run my program
I get an exception (see below). I tried giving...
|
by: palepimp |
last post by:
Hello all,
I have searched far and wide for a solution to my issue. In short, here is the problem:
1. 3 PC's enter data into an Access 2003 database (PC's are running Vista w/ Office 2007...
|
by: DotNetNewbie |
last post by:
Hello,
in my web application, I have to create permissions for each user. So
what I am doing is that for each role (using sqlmembership in .net) I
am creating a column in the database to hold a...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |