i have a project that receives virtual directories from IIS, and show the files in directories as an windows application form. Here my problem with defining the path as
Directory.GetDirectories(dataDirectory)
dataDirectory including the code is: //LM//W3SVC//1//Root//Data//
also when i try another format as
iis://localhost//w3svc//1//root//data and //localhost//W3SVC//1//Root//Data// anad also one back slash, same error result i took...
public void CreateFormsMenuItems(BarManager barManager, BarSubItem formsBarSubItem, ItemClickEventHandler formsBaritem_ItemClick, string dataDirectory)
{
foreach (string dirName in Directory.GetDirectories(dataDirectory))
{
BarSubItem barsubitem = new BarSubItem();
barsubitem.Category = barManager.Categories["Forms"];
barsubitem.Caption = Path.GetFileNameWithoutExtension(dirName);
barsubitem.Tag = dirName;
//baritem.ItemClick += new ItemClickEventHandler(formsBaritem_ItemClick);
barsubitem.ImageIndex = 5;
barManager.Items.Add(barsubitem);
formsBarSubItem.AddItem(barsubitem);
CreateFormsMenuItems(barManager, barsubitem, formsBaritem_ItemClick, dirName);
}
foreach (string fileName in Directory.GetFiles(dataDirectory))
{
BarButtonItem baritem = new BarButtonItem();
baritem.Category = barManager.Categories["Forms"];
baritem.Caption = Path.GetFileNameWithoutExtension(fileName);
baritem.Tag = fileName;
baritem.ItemClick += new ItemClickEventHandler(formsBaritem_ItemClick);
baritem.GroupIndex = 1;
baritem.ButtonStyle = BarButtonStyle.Check;
baritem.ImageIndex = 4;
barManager.Items.Add(baritem);
formsBarSubItem.AddItem(baritem);
}
}
DirectoryEntry dataDir = new DirectoryEntry("IIS://localhost/w3svc/root/1/Data/");
how i get rid of the format error? could you help me, please...