webForumDet fria alternativet

DirectoryEntry problem

1 svar · 203 visningar · startad av aleborg

aleborgMedlem sedan jan. 20013 341 inlägg
#1

Jag har följande kod för att uppdatera i IIS:en:

DirectoryEntry newRoot= new DirectoryEntry("IIS://" + server + "/W3SVC");
DirectoryEntry deNewVDir = newRoot.Children.Find(websitenumber,"IIsWebVirtualDir");
				
deNewVDir.Properties["Path"][0] = homepath;
				
deNewVDir.CommitChanges();
newRoot.CommitChanges();

deNewVDir.Close();
newRoot.Close();

Men får följande exception:
System.Runtime.InteropServices.COMException (0x80005008): Exception from HRESULT: 0x80005008. at System.DirectoryServices.Interop.IAdsContainer.GetObject(String className, String relativeName) at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName) at WebCreSiterWeb.IISWebsite.EditTarget()

Hur gör man egentligen för att ändra mha DirectoryEntry?

aleborgMedlem sedan jan. 20013 341 inlägg
#2

löste det, var inne i fel del av sökvägen bara :r

131 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
128 ms — hämta tråd, inlägg och bilagor (db)