DirectoryEntry and CopyTo function

M

Mik

Hi

I am struggling to make a Web site/Web Directory copy work. I am using
the System.DirectoryServices to connect to my localhost machine.

There I have two web sites: Mysite1 (siteno 1) and Mysite2 (siteno 2).
I want to copy one directory or web app from Mysite1 to Mysite2 and I
cant get it to work. Have tried alot of different ways but no one will
work.

Heres a code example

Imports System.DirectoryServices

Public Sub Copy()
Dim oIIS_Source As New DirectoryEntry
"IIS://localhost/w3svc/2/root/test")
Dim oIIS_Target As New
DirectoryEntry("IIS://localhost/w3svc/1/root/test")
Dim oNewDir as DirectoryEntry

oNewDir = oIIS_Source.CopyTo(oIIS_Target)

I get "Path not found" error.

I can create Virtual directories by using DirectoryEntry but I cant
copy one to the other.

Any ideas?
Regards
Mikael





End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top