T
tsupchurch
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.FullName,
file.Name), True)
Else
If
((System.IO.File.Exists(System.IO.Path.Combine(destDir.FullName,
file.Name))) = False) Then
file.CopyTo(System.IO.Path.Combine(destDir.FullName, 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.
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.FullName,
file.Name), True)
Else
If
((System.IO.File.Exists(System.IO.Path.Combine(destDir.FullName,
file.Name))) = False) Then
file.CopyTo(System.IO.Path.Combine(destDir.FullName, 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.