<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164680</guid>
        <pubDate>Sat, 01 Mar 2003 05:08:28 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164680</link>
        <description><![CDATA[hummy: Ну или через Актив Хэ, как в данном случае. Соррь, не спал давно. Дык в помошью Актив Хэ, как показывает практика, можно не только в файл написать, но и систему пустить в длительное эротическое путешествие.]]></description>
        <author>hummy</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164679</guid>
        <pubDate>Sat, 01 Mar 2003 05:04:42 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164679</link>
        <description><![CDATA[hummy: Дык правильно, это через filesystemobject, который, как известно из физики, имеет место только в java server pages, которые, как недавно договорильсь, яваскриптом не являются.]]></description>
        <author>hummy</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164678</guid>
        <pubDate>Sat, 01 Mar 2003 04:58:06 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164678</link>
        <description><![CDATA[negram: Мне вот тута с рассылкой прислали ::)<br>имхо кому-нибудь может пригадится по крайней мере для общего арзвития<br><div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&#60;br&#62;////////////////////////////////////////////////////////////////////&#60;br&#62;// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&#60;br&#62;// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Поиск и замена текста в файлах &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&#60;br&#62;// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Автор: Scripter (www.script-info.net) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&#60;br&#62;// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//&#60;br&#62;/////////////////////////////////////////////////////////////////////&#60;br&#62;&#60;br&#62;var Новая_строка = &quot;\r\n&quot;;&#60;br&#62;var Поиск_и_Замену = 0;&#60;br&#62;var Добавление_в_Начало = 1;&#60;br&#62;var Добавление_в_Конец = 2;&#60;br&#62;&#60;br&#62;// Настройка утилиты&#60;br&#62;// =================&#60;br&#62;var Тип_Файлов=&quot;HTML&quot;; // Вариант - &quot;Файл &#39;PHP&#39;&quot; и т.д.&#60;br&#62;var Выполнить = Поиск_и_Замену; // Добавление_в_Начало | Добавление_в_Конец&#60;br&#62;var Каталог=&quot;c:\web\html&quot;;&#60;br&#62;var Шаблон_Поиска = /http:\/\/www\.script-info\.net\/\?rd=dhtml&amp;rf=html\/htmltags\.php?=/ig ;&#60;br&#62;// Если выбран режим &quot;Добавление_в_...&quot; тут пишем, что добавить:&#60;br&#62;var Заменить_На = &quot;http://www.script-info.net/dhtml/html/htmltags.php?part=&quot;;&#60;br&#62;&#60;br&#62;/* Регулярные выражения&#60;br&#62;справка на http://script-info.net/jsvbs/msscript/js56/js56jsgrpregexpsyntax.php&#60;br&#62;-------------------------&#60;br&#62;Спецсимволы, которые необходимо&#60;br&#62;экранировать в шаблоне поиска слэшем (\):&#60;br&#62;) ( . / ? ^ $ * + } { ] [&#60;br&#62;&#60;br&#62;Краткая справка&#60;br&#62;-------------------------&#60;br&#62;^ начало строки&#60;br&#62;$ конец строки&#60;br&#62;* {0,} ноль и более раз&#60;br&#62;+ {1,} один и более&#60;br&#62;? {0,1} ноль или один&#60;br&#62;? после (*, +, ?, {n}, {n,}, {n,m}) обозначает&#60;br&#62; &quot;выбрать комбинацию минимальной длины&quot;&#60;br&#62; . любой символ кроме \n&#60;br&#62;[.\n] любой символ&#60;br&#62;&#60;br&#62;параметры:&#60;br&#62;-------------------------&#60;br&#62;i игнорировать регистр при поиске&#60;br&#62;g искать все вхождения&#60;br&#62;&#60;br&#62;примеры:&#60;br&#62;-------------------------&#60;br&#62;&#60;br&#62;/^\[ \t]*$/g &nbsp;поиск пустых строк&#60;br&#62;&#60;br&#62;Windows (?=95|98|NT|2000) Соответствует слову &quot;Windows&quot; в фразе&#60;br&#62; &nbsp; &quot;Windows 2000&quot; но не в фразе &quot;Windows 3.1&quot;.&#60;br&#62;*/&#60;br&#62;&#60;br&#62;//////////////////////////////////////////////////////////////////////&#60;br&#62;// Дальше что-либо менять нежелательно&#60;br&#62;&#60;br&#62;var Счет = 0;&#60;br&#62;var Файлов = 0;&#60;br&#62;var ForReading = 1, ForWriting = 2, ForAppending = 8;&#60;br&#62;var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;&#60;br&#62;var WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;);&#60;br&#62;var fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);&#60;br&#62;CurrentFolder = Каталог;&#60;br&#62;ScanFolders(CurrentFolder);&#60;br&#62;WSHShell.Popup(&quot;Работа выполнена&quot; + Новая_строка + Новая_строка +&#60;br&#62; &nbsp; &nbsp;&quot;Файлов изменено:\t&quot; + Файлов + Новая_строка +&#60;br&#62; &nbsp; &nbsp;&quot;Число операций:\t\t&quot; + Счет);&#60;br&#62;&#60;br&#62;// Проверяем все вложенные подкаталоги&#60;br&#62;function ScanFolders(folderspec) {&#60;br&#62;//WSHShell.Popup(folderspec);&#60;br&#62; var f, fc;&#60;br&#62; SearchFiles(folderspec);&#60;br&#62; f = fso.GetFolder(folderspec);&#60;br&#62; fc = new Enumerator(f.SubFolders);&#60;br&#62; for (; !fc.atEnd(); fc.moveNext())&#60;br&#62; {&#60;br&#62; &nbsp; &nbsp; NextFolder = fc.item();&#60;br&#62; &nbsp; &nbsp; ScanFolders(NextFolder);&#60;br&#62; }&#60;br&#62;}&#60;br&#62;// Получение списка файлов в каталоге&#60;br&#62;function SearchFiles(folderspec) {&#60;br&#62; &nbsp; var f, fc, s;&#60;br&#62; &nbsp; f = fso.GetFolder(folderspec);&#60;br&#62; &nbsp; fc = new Enumerator(f.files);&#60;br&#62; &nbsp; s = &quot;&quot;;&#60;br&#62; &nbsp; for (; !fc.atEnd(); fc.moveNext())&#60;br&#62; &nbsp; {&#60;br&#62; &nbsp; &nbsp; &nbsp;s = fc.item();&#60;br&#62; &nbsp; CurrentType=FileType(s);&#60;br&#62; &nbsp; &nbsp;if(CurrentType.search(Тип_Файлов)==0){&#60;br&#62; &nbsp;switch (Выполнить) {&#60;br&#62; &nbsp; case Поиск_и_Замену :&#60;br&#62; &nbsp; &nbsp;FileModyfy(s);&#60;br&#62; &nbsp; &nbsp;break;&#60;br&#62; &nbsp; case Добавление_в_Начало :&#60;br&#62; &nbsp; &nbsp;AppedBegin(s);&#60;br&#62; &nbsp; &nbsp;break;&#60;br&#62; &nbsp; case Добавление_в_Конец :&#60;br&#62; &nbsp; &nbsp;AppedEnd(s);&#60;br&#62; &nbsp; &nbsp;break;&#60;br&#62; &nbsp;}&#60;br&#62; &nbsp; &nbsp;}&#60;br&#62; &nbsp; }&#60;br&#62;}&#60;br&#62;// получение типа файла&#60;br&#62;function FileType(filespec) {&#60;br&#62; &nbsp; var f, s;&#60;br&#62; if (fso.FolderExists(filespec)){&#60;br&#62; &nbsp; &nbsp; &nbsp;f = fso.GetFolder(filespec);&#60;br&#62; } else {&#60;br&#62; &nbsp;if (fso.FileExists(filespec)) {&#60;br&#62; &nbsp; f = fso.GetFile(filespec);&#60;br&#62; &nbsp;} else {&#60;br&#62; &nbsp; s = &quot;Error: File or Folder does not find.&quot;;&#60;br&#62; &nbsp;}&#60;br&#62; &nbsp;s = f.Type;&#60;br&#62; }&#60;br&#62; //WSHShell.Popup (s);&#60;br&#62; return(s);&#60;br&#62;}&#60;br&#62;// добавление строки в начало&#60;br&#62;function AppedBegin(currentFile) {&#60;br&#62; FileHeader = currentFile.OpenAsTextStream(ForReading, TristateUseDefault);&#60;br&#62; FileString = FileHeader.ReadAll();&#60;br&#62; FileHeader.Close( );&#60;br&#62; FileString = Заменить_На + FileString;&#60;br&#62; &nbsp;FileHeader = currentFile.OpenAsTextStream(ForWriting, TristateUseDefault);&#60;br&#62; &nbsp;FileHeader.Write(FileString);&#60;br&#62; &nbsp;FileHeader.Close( );&#60;br&#62; Файлов += 1;&#60;br&#62; Счет += 1;&#60;br&#62;}&#60;br&#62;// добавление строки в конец&#60;br&#62;function AppedEnd(currentFile) {&#60;br&#62; FileHeader = currentFile.OpenAsTextStream(ForReading, TristateUseDefault);&#60;br&#62; FileString = FileHeader.ReadAll();&#60;br&#62; FileHeader.Close( );&#60;br&#62; FileString = FileString + Заменить_На;&#60;br&#62; &nbsp;FileHeader = currentFile.OpenAsTextStream(ForWriting, TristateUseDefault);&#60;br&#62; &nbsp;FileHeader.Write(FileString);&#60;br&#62; &nbsp;FileHeader.Close( );&#60;br&#62; Файлов += 1;&#60;br&#62; Счет += 1;&#60;br&#62;}&#60;br&#62;// удаление/замена строки&#60;br&#62;function FileModyfy(currentFile) {&#60;br&#62; FileHeader = currentFile.OpenAsTextStream(ForReading, TristateUseDefault);&#60;br&#62; FileString = FileHeader.ReadAll();&#60;br&#62; FileHeader.Close( );&#60;br&#62; var tr = FileString.match(Шаблон_Поиска);&#60;br&#62; if (tr)&#60;br&#62; {&#60;br&#62; &nbsp;Счет = Счет + tr.length;&#60;br&#62; &nbsp;Файлов += 1;&#60;br&#62; }&#60;br&#62; FileString = FileString.replace(Шаблон_Поиска, Заменить_На);&#60;br&#62; &nbsp;FileHeader = currentFile.OpenAsTextStream(ForWriting, TristateUseDefault);&#60;br&#62; &nbsp;FileHeader.Write(FileString);&#60;br&#62; &nbsp;FileHeader.Close( );&#60;br&#62;}&#60;br&#62;&#60;br&#62;&#60;br&#62;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>negram</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164677</guid>
        <pubDate>Sun, 23 Feb 2003 21:08:56 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164677</link>
        <description><![CDATA[hummy: Это да..]]></description>
        <author>hummy</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164676</guid>
        <pubDate>Sun, 23 Feb 2003 21:03:54 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164676</link>
        <description><![CDATA[Therion: Да? Ну пофиг, признаться, всеравно глупо такой фигней страдать, имху.]]></description>
        <author>Therion</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164675</guid>
        <pubDate>Sun, 23 Feb 2003 15:28:56 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164675</link>
        <description><![CDATA[hummy: Не, скорре всего будет согласен (если у него настройки IE дефолтные) :)]]></description>
        <author>hummy</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164674</guid>
        <pubDate>Sun, 23 Feb 2003 11:02:35 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164674</link>
        <description><![CDATA[Therion: Можно использую VBScript попытаться записать инфу в файл на локальной машине, но юзер скорее всего будет несогласен. ж) &nbsp;;D]]></description>
        <author>Therion</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164673</guid>
        <pubDate>Sun, 23 Feb 2003 10:36:36 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164673</link>
        <description><![CDATA[vot: нельзя.]]></description>
        <author>vot</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164672</guid>
        <pubDate>Sun, 23 Feb 2003 10:34:40 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164672</link>
        <description><![CDATA[Max111: А чтоб при наведении на кнопку записывался любой текст в файл можно?]]></description>
        <author>Max111</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164671</guid>
        <pubDate>Sun, 23 Feb 2003 10:33:10 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164671</link>
        <description><![CDATA[vot: Никак.]]></description>
        <author>vot</author>
        <category>RegExp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164670</guid>
        <pubDate>Sun, 23 Feb 2003 10:28:22 +0000</pubDate>
        <title>JavaCript. Запись в файл</title>
        <link>https://forum.sources.ru/index.php?showtopic=22173&amp;view=findpost&amp;p=164670</link>
        <description><![CDATA[Max111: Есть кнопка. При наведении курсора выскакивает alert. Как сделать, чтобы текст alert'а записывался в файл?]]></description>
        <author>Max111</author>
        <category>RegExp</category>
      </item>
	
      </channel>
      </rss>
	