bill201
asked on
problem with a web code
hi there
what is the probkem with this code, i have a file with the name log.txt and i use the code below but i get the error message 500 internal server error
this is my web site
what is the probkem with this code, i have a file with the name log.txt and i use the code below but i get the error message 500 internal server error
<%
dim FSO,FO
FileName= Server.MapPath ("log.txt")
set FSO = server.createobject ("scripting.filesystemobject")
set FO= FSO.opentextfile (FileName,2)
fO.writeline "Hi there"
FO.close
set FSO=nothing
set FO=nothing
%>
this is my web site
You need to make sure the web service account has write permissions to the txt file :)
ASKER
sorry i was wrong the host is managed by asp.net
the code you posted is for classic asp, not asp.net
did you manage to send errors to the browser?
did you manage to send errors to the browser?
ASKER
no i don't know how to do is, so i think to delete this message becasue i see that i have a lot holes on asp.net
Server.MapPath is the PATH to the desired file and not the file itself.
replace
FileName= Server.MapPath ("log.txt")
with
FileName= Server.MapPath (".") ' current directory
Filename = Filename & "\log.txt"
https://msdn.microsoft.com/en-us/library/ms524632%28v=VS.90%29.aspx
replace
FileName= Server.MapPath ("log.txt")
with
FileName= Server.MapPath (".") ' current directory
Filename = Filename & "\log.txt"
https://msdn.microsoft.com/en-us/library/ms524632%28v=VS.90%29.aspx
ASKER
thanks David Johnson for your comment i try this, and it's not working i spoke to my web provider and he said me that my website are supporting on asp (asp classic) and asp .net.
thanks dejaanbu for your comment
i'm sorry that i haven't responded, the truth is that i am a bit Embarrassed, because the articles on the links are difficult for me (probably i don't have enough knowledge), so i tried to take extra time to Concentrate On this articles but i haven't succeeded to understand the articles.
thanks dejaanbu for your comment
i'm sorry that i haven't responded, the truth is that i am a bit Embarrassed, because the articles on the links are difficult for me (probably i don't have enough knowledge), so i tried to take extra time to Concentrate On this articles but i haven't succeeded to understand the articles.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default
once you do that, you should get a better message telling you what's wrong