заметка опять же более для себя.
помятуя
об этом, для сравнения вот
public static void AddOpenedArticle( String sectionName, Int32 articlesNumber )
{
/*
* 1. Загружаем файл
* 2. Находим и записываем нужные узлы
* 3. Обновляем значения в узлах с учетом присланного числа статей
* 4. Сохраняем изменения.
* 5. Используя функции IncreaseArticlesTotalNumber и IncreaseArticlesTotalNumberSpecificType
* обновляем общую статистику
*/
// 1.
XmlDocument infoFile = new XmlDocument();
infoFile.Load( sysFilePath );
// 2.
// получение узла секции
XmlNode sectionNode = infoFile.SelectSingleNode( sysInfoSectionNodeXPathLeftPart + sectionName + sysInfoSectionNodeXPathRightPart );
// запись нужных узлов
XmlNode articlesTotal = sectionNode.SelectSingleNode( sysInfoSectionXPathArticlesTotal );
XmlNode openedArticlesTotal = sectionNode.SelectSingleNode( sysInfoSectionXPathOpenedArticles );
// 3.
Int32 oldValueOfArticlesTotal = Convert.ToInt32( articlesTotal.FirstChild.Value );
Int32 oldValueOfOpenedArticlesTotal = Convert.ToInt32( openedArticlesTotal.FirstChild.Value );
Int32 newValueOfArticlesTotal = oldValueOfArticlesTotal + articlesNumber;
Int32 newValueOfOpenedArticlesTotal = oldValueOfOpenedArticlesTotal + articlesNumber;
articlesTotal.FirstChild.Value = newValueOfArticlesTotal.ToString();
openedArticlesTotal.FirstChild.Value = newValueOfOpenedArticlesTotal.ToString();
String errorString = newValueOfArticlesTotal.ToString() + " and " + newValueOfOpenedArticlesTotal.ToString();
// 4.
infoFile.Save( sysFilePath );
// 5.
IncreaseArticlesTotalNumber( articlesNumber );
IncreaseArticlesTotalNumberSpecificType( articlesNumber, ArticleAccessType.open );
}//AddOpenedArticle
Is anybody home?
[Print]
Мист