public override string Index(string folderPath) { FolderInfo folderInfo = GetFolderInfo(folderPath); folderInfo.Update(); XmlWriterSettings xmlWriterSettings = new XmlWriterSettings(); xmlWriterSettings.Encoding = new UTF8Encoding(false); xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document; xmlWriterSettings.Indent = true; using (MemoryStream ms = new MemoryStream()) { using (xmlWriter = XmlWriter.Create(ms, xmlWriterSettings)) { xmlWriter.WriteStartDocument(); IndexFolder(folderInfo); xmlWriter.WriteEndDocument(); xmlWriter.Flush(); } return(Encoding.UTF8.GetString(ms.ToArray())); } }
public virtual string Index(string folderPath) { FolderInfo folderInfo = GetFolderInfo(folderPath); folderInfo.Update(); IndexFolder(folderInfo); return(sbContent.ToString()); }