Foros del Web » Programando para Internet » ASP Clásico »

Problema al hacer un chat en asp

Estas en el tema de Problema al hacer un chat en asp en el foro de ASP Clásico en Foros del Web. hola amigos programadores tengo un problema al hacer un chat en asp, el cual es el siguiente, el explorador me presenta un error: Microsoft VBScript ...
  #1 (permalink)  
Antiguo 08/02/2005, 14:51
Avatar de emilio21  
Fecha de Ingreso: enero-2005
Ubicación: Venezuela
Mensajes: 320
Antigüedad: 19 años, 5 meses
Puntos: 1
Información Problema al hacer un chat en asp

hola amigos programadores tengo un problema al hacer un chat en asp, el cual es el siguiente, el explorador me presenta un error:

Microsoft VBScript runtime error '800a0046'

Permission denied

/chat2/chat.asp, line 49

EL CUAL LA LINEA 49 CONTINE LO SIGUIENTE:
Set inStream = fileObject.OpenTextFile(textFile,8,True,FALSE)

al intentar abrir el archivo de texto.

EL CODIGO COMPLETO ES:

<%
Response.Expires=-1000
Topic = Session("Topic")
Name = Session("Name")
If Request("RefreshRate") <> Empty Then
Session("RefreshRate") = Request("RefreshRate")
Else
Session("RefreshRate") = Session("RefreshRate")
End If

If Session("RefreshRate") = "" Then
Session("RefreshRate") = 10000
End If
%>

<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--



function update(){
document.location.href="chat.asp"

}

function toBottom(){
if(document.all){
window.scroll(0, document.body.clientHeight);
}else{
window.scroll(0,20000)
}
}

setTimeout("update()",<%=Session("RefreshRate")%>) ;
//-->

</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Chat :::WebEXtrema.Com::</title></head>
<BODY BGCOLOR="#003366" onLoad="toBottom()">
<br>
<FONT SIZE=2 FACE="Verdana,Arial">
<%
Set fileObject = Server.CreateObject("Scripting.FileSystemObject")
'Map appropriate topic file
textFile = Server.MapPath("files/" & Replace(Topic, "+", "_") & ".txt")
If Not fileObject.FileExists(textfile) Then
Set inStream = fileObject.OpenTextFile(textFile,8,True,FALSE)
inStream.WriteLine " "
End If

Set inStream = fileObject.OpenTextFile(textFile,1,TRUE,FALSE)


file = inStream.ReadAll
Set inStream = Nothing

If Len(file) > 5000 Then
'archive the old file
'archive name is topic_date put under files/archives
archiveFile = Server.MapPath("files/" & Replace(Topic, "+", "_") & "_" & Server.URLEncode(Now) & ".txt")
Set inStream = fileObject.CreateTextFile(archiveFile,True)
inStream.Write file
inStream.Close
Set inStream = Nothing


Set inStream = fileObject.CreateTextFile(textFile,True)
inStream.Write " "
Set inStream = Nothing
file = " "
End If

If IsNull(Session("Enter")) Or Session("Enter") = True Then
file = file & "<FONT SIZE=2 FACE='Vedana,Arial' Color=#808080><b>***[" & name & " Ha Entrado a la Sala de Chat de WebExtrema.Com (" & Now & ")]***</b></FONT><br>"
Session("Enter") = False
End If

If Request.Form("Add") = "TRUE" Then
file = file & "<FONT SIZE=2 Color=#000000 FACE='Verdana,Arial'><b>" & name & "</b><small>(" & Now & ")</small>:</FONT>" & Request("Msg") & "<br>"
End If

Set outStream = fileObject.CreateTextFile(textFile,True)
outStream.WriteLine(file)
Set outStream = Nothing

Response.Write "<font color=#000000>" & file & ""

PrivRcpt = Application("PrivateRcpt")
Match = 0
If IsArray(PrivRcpt) Then
PrivateMsgs = Application("PrivateMsgs")
NumOfRcpt = UBound(PrivRcpt)
ReDim Preserve UpdatedPrivRcpt(1)
ReDim Preserve UpdatedPrivMsg(1)
For I = 0 To NumOfRcpt
If Name = PrivRcpt(I) Then
Response.Write "<FONT color=#ff0000 SIZE=2 FACE='Verdana,Arial'><b>*** " & PrivateMsgs(I) & " ***</b></font>"
Else
ReDim Preserve UpdatedPrivRcpt(Match)
ReDim Preserve UpdatedPrivMsg(Match)
UpdatedPrivRcpt(Match) = PrivRcpt(I)
UpdatedPrivMsg(Match) = PrivateMsgs(I)
Match = Match + 1
End If
Next
Application("PrivateRcpt") = UpdatedPrivRcpt
Application("PrivateMsgs") = UpdatedPrivMsg
End If

%>
</FONT>
<br>
<br>


<br>

</BODY>
</HTML>

GRACIAS. NECESITO QUE ME AYUDEN LO MAS RAPIDO POSIBLE
  #2 (permalink)  
Antiguo 09/02/2005, 07:35
 
Fecha de Ingreso: abril-2004
Mensajes: 25
Antigüedad: 20 años, 2 meses
Puntos: 0
Buenas Emilio21,

¿Has asignado los permisos necesarios al usuario con el que estas intentando acceder al directorio en el que quieres abrir el archivo?

Necesitas asignar permisos NTFS (al menos de lectura/escritura) al usuario con el que estás ejecutando la página.
__________________
El saber no es lo importante, lo verdaderamente importante, es conocer al que sabe.
  #3 (permalink)  
Antiguo 11/02/2005, 15:36
Avatar de emilio21  
Fecha de Ingreso: enero-2005
Ubicación: Venezuela
Mensajes: 320
Antigüedad: 19 años, 5 meses
Puntos: 1
si ya le di los permisos pero me da error en la linea 49
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:47.