Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Copying Folders while maintaining permissions in ASP.NET 1.1

Reply
Thread Tools

Copying Folders while maintaining permissions in ASP.NET 1.1

 
 
tsupchurch@gmail.com
Guest
Posts: n/a
 
      07-18-2006
Good day everyone,

I've been searching for a solution to the problem of copying folders
using an ASP.NET on a windows 2000 server with .net 1.1. I have tried
using the directory class and the file system object and both
succesfully copy folders, however they do not maintain permissions.
Here is the sample code:

If (overwrite) Then
file.CopyTo(System.IO.Path.Combine(destDir.FullNam e,
file.Name), True)
Else
If
((System.IO.File.Exists(System.IO.Path.Combine(des tDir.FullName,
file.Name))) = False) Then

file.CopyTo(System.IO.Path.Combine(destDir.FullNam e, file.Name), False)
End If
End If


Next I tried using a batch file in conjunction with robocopy.exe
(http://www.ss64.com/nt/robocopy.html) however there seems to be a
restriction on ASP pages using the shell to execute server side
process.

sample:

CreateInquiryInfo.FileName = "robocopy.exe"

CreateInquiryInfo.WorkingDirectory = "C:\working\"

CreateInquiryInfo.Arguments = """C:\File Template"" ""C:\~New\" &
tLabel.Text & "\" & Label2.Text & """ /E /SEC /CREATE /V
/LOG:C:\Results.log"

InquiryProcess = Process.Start(CreateInquiryInfo)

InquiryProcess.WaitForExit(2000)


***

It seems like .NET 2.0 made this a much easier. But i've got some
restrictions here, so any help would be much appreciated. Also
permissions aren't the issue, i've already worked through that.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Redirect to self while maintaining view state =?Utf-8?B?amNsYXJrMDczMQ==?= ASP .Net 3 04-09-2005 09:24 AM
Converting GET URL to a POSTed one while maintaining session Keith Patrick ASP .Net 1 02-03-2005 08:24 PM



Advertisments