RESPONDER UNA PREGUNTA

Si para responder la pregunta, crees necesario enviar un archivo adjunto, puedes hacerlo a traves del correo [email protected]

    Pregunta:  62223 - ERROR AL CAPTURAR LA VARIABLE HTTP_X_FORWARDED_FOR
Autor:  Jose Vela
Quisiera saber si alguien me podria ayudar con el siguiente problema
Para poner seguridad en una intranet capturo el ip del cliente con la variable
HTTP_X_FORWARDED_FOR, luego creo una funcion enviando el Ip del cliente
mas o menos de esta forma.

strIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
function GetMACAddress(strIP)

En la funcion creo un texto con el nombre de la IP

Set ts = fso.opentextfile(rutafile & strIP & ".txt")

El problema eas que solo en algunos usuarios me crea dicho archivo texto no entiendo cual es la razon que en algunos usuarios no lo haga, al no crear el archivo, da error de ingreso a mi intranet

este es el codigo:

<%

rutafile = Server.MapPath(".")+" mpfiles"
strIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
strMac = GetMACAddress(strIP)
strHost = Request.ServerVariables("REMOTE_HOST")
function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > "&rutafile & strIP & ".txt",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile(rutafile & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
if instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do
End if
loop
ts.close
Set ts = nothing

Set fso = nothing
GetMACAddress = macaddress
End function
%>

Gracias de Antemano


Nombre
Apellidos
Correo
Comentarios