Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Ошибка, Подскажите!!! 
:(
    Опции темы
Solka
  Дата 24.9.2004, 07:27 (ссылка)    |    (голосов: 0) Загрузка ... Загрузка ... Быстрая цитата Цитата


Unregistered











rolleyes.gif Народ! плз помогите найти ошибку. Вроде все правильно делаю...
У меня есть файлик текстовый, когда к нему обращаешься для того чтобы перенести данные в другой файл или вовсе удалить (action=del) - он долго, долго грузится, а потом выдает вот эту ошибку:

Error Type:
Active Server Pages, ASP 0113 (0x80004005)
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
/site/ind_news_4.asp


Вот сам код:
Код
<%
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")

action = Request.QueryString("action")
Set f_gb = fs.OpenTextFile("c:\news.txt", 1, 0)
gb_id = f_gb.ReadLine
last_id = CInt(Right(gb_id, Len(gb_id)-1))
f_gb.Close
Set f_gb = Nothing
  gb_nid = CInt(Request.QueryString("number"))
   
if (action="del") and (Request.QueryString("number")<>"") then
         s="0"
  Set f_gb_old = fs.OpenTextFile("c:\news.txt", 1, 0)
  gb_id = f_gb_old.ReadLine
  While not f_gb_old.AtEndOfStream
    If (gb_id=gb_nid) then
  s="1"
  gb_thema = f_gb_old.ReadLine
  gb_tfile = f_gb_old.ReadLine
  End if
  Wend
  f_gb_old.Close
  Set f_gb_old = Nothing
 
If (s="1") then
 
 temp = ""
 For i = 1 to len(gb_tfile)
  If left(gb_tfile, 1) = "#" then
   temp = temp + "№"
  Else
   temp = temp + left(gb_tfile, 1)
  End If
  gb_tfile = right(gb_tfile, len(gb_tfile) - 1)
 
 gb_tfile = temp

 Next


 Set f_gb_new = fs.CreateTextFile("c:\news_tmp.txt", True)
  Set f_gb_old = fs.OpenTextFile("c:\news.txt", 1, 0)
  While not f_gb_old.AtEndOfStream
   gb_id = f_gb_old.ReadLine
   gb_id = CInt(Right(gb_id, Len(gb_id)-1))
   if not f_gb_old.AtEndOfStream then gb_thema = f_gb_old.ReadLine
   if not f_gb_old.AtEndOfStream then gb_tfile = f_gb_old.ReadLine
   If (gb_id<>gb_nid) then
    f_gb_new.WriteLine("#" & gb_id)
      f_gb_new.WriteLine(gb_thema)
      f_gb_new.WriteLine(gb_tfile)
   End if
  Wend
  f_gb_old.Close
  Set f_gb_old = Nothing
  f_gb_new.Close
  Set f_gb_new = Nothing
         fs.MoveFile "c:\news.txt", "c:\news_old.txt"
  fs.DeleteFile "c:\news.txt", True
  fs.MoveFile "c:\news_tmp.txt", "c:\news.txt"

%>
<span style="font-size:8.0pt;font-family:Verdana;">
Файл с именем:
<%=(Request.QueryString("number"))%>
удален
</span>
<br>
<%
End if
else
if (action="del") and (Request.QueryString("number")="") then %>
<span style="font-size:8.0pt;font-family:Verdana;">
<b>Введите имя файла</b>
</span>
<%
End if
End if
%>

<%
If s="0" then %>
<span style="font-size:8.0pt;font-family:Verdana;">
<b>Файла с таким именем не существует:</b>
<%=(Request.QueryString("number"))%></span>

<%

End if
%>
<%



If (action="add") then
 gb_id = Request.QueryString("id")
 gb_tema = Trim(Request.QueryString("tema"))
 gb_datetime = Now()
 gb_message = Trim(Request.QueryString("message"))
 
 If (gb_message="") or (gb_message="Ввод новости...") then gb_id=last_id
 
 
 temp = ""
 For i = 1 to len(gb_message)
  If left(gb_message, 1) = "#" then
   temp = temp + "№"
  Else
   temp = temp + left(gb_message, 1)
  End If
  gb_message = right(gb_message, len(gb_message) - 1)
 Next
 gb_message = temp
 
 If (gb_id<>last_id) then
  Set f_gb = fs.CreateTextFile("c:\\news_tmp.txt", True)
  f_gb.WriteLine("#" & gb_id)
  f_gb.WriteLine(gb_tema)
  f_gb.WriteLine(gb_datetime)
  f_gb.WriteLine(gb_message)
  Set f_gb_old = fs.OpenTextFile("c:\news.txt", 1, 0)
  While not f_gb_old.AtEndOfStream
   line = f_gb_old.ReadLine
   f_gb.WriteLine(line)
  Wend
  f_gb_old.Close
  Set f_gb_old = Nothing
  f_gb.Close
  Set f_gb = Nothing
  fs.DeleteFile "c:\news.txt", True
  fs.MoveFile "c:\news_tmp.txt", "c:\news.txt"
 End if
%>  
 <span style="font-size:8.0pt;font-family:Verdana;">
Данные введены успешно. Спасибо,
<%=(Request.QueryString("Login"))%></span>
<% End if


If (action="del") then
 gb_id = CInt(Request.QueryString("id"))
 gb_tema = Trim(Request.QueryString("tema"))
 gb_datetime = Now()
 gb_message = Trim(Request.QueryString("message"))
 

 temp = ""
 For i = 1 to len(gb_message)
  If left(gb_message, 1) = "#" then
   temp = temp + "№"
  Else
   temp = temp + left(gb_message, 1)
  End If
  gb_message = right(gb_message, len(gb_message) - 1)
 Next
 gb_message = temp
 
 If (gb_id<>last_id) then
  Set f_gb = fs.CreateTextFile("c:\news_tmp.txt", True)
  f_gb.WriteLine("#" & gb_id)
  f_gb.WriteLine(gb_tema)
  f_gb.WriteLine(gb_datetime)
  f_gb.WriteLine(gb_message)
  Set f_gb_old = fs.OpenTextFile("c:\news.txt", 1, 0)
  While not f_gb_old.AtEndOfStream
   line = f_gb_old.ReadLine
   f_gb.WriteLine(line)
  Wend
  f_gb_old.Close
  Set f_gb_old = Nothing
  f_gb.Close
  Set f_gb = Nothing
  fs.DeleteFile "c:\news.txt", True
  fs.MoveFile "c:\news_tmp.txt", "c:\news.txt"
 End if
End if

%>


Заранее спсб
  Вверх
Ignat
Дата 24.9.2004, 10:23 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Флудератор
****


Профиль
Группа: Экс. модератор
Сообщений: 4030
Регистрация: 19.4.2004
Где: غيليندزيك مدينة

Репутация: 1
Всего: 73



А файл, который ты грузишь большой?


--------------------
Теперь при чем :P
PM   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | ASP | Следующая тема »


 




[ Время генерации скрипта: 0.0398 ]   [ Использовано запросов: 21 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.