ASP.net password system
I want this asp.net page to acess a text file out side of the website folder. I have permissions on the host. I used to do it in asp. The proublem showed up when I did it in ASP.net. The fallowing code.....
}var objFS : Object = new ActiveXObject("Scripting.FileSystemObject");
var objTextS : Object = objFS.OpenTextFile(Server.MapPath("../../database/wds.txt"),1,false);
Gives me this error...
Quote: Cannot use a leading .. to exit above the top directory.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.
See the error for your self at http://www.oldbja888.com/oldbja888/ any password will generate the error.
Thankx in advance.
dk01 posted this at 15:25 — 22nd March 2005.
He has: 516 posts
Joined: Mar 2002
Try using an absolute path. You will have to ask the host for this.
-dk
bja888 (not verified) posted this at 18:14 — 22nd March 2005.
They have: 5,633 posts
Joined: Jan 1970
I have never had any sucess with a absolute path. On 2 servers and my own computer with IIS.
dk01 posted this at 19:29 — 22nd March 2005.
He has: 516 posts
Joined: Mar 2002
Well its the only other alternative.
-dk
timjpriebe posted this at 20:11 — 22nd March 2005.
He has: 2,667 posts
Joined: Dec 2004
That's weird. I've never had any problems with absolute paths.
bja888 (not verified) posted this at 21:04 — 22nd March 2005.
They have: 5,633 posts
Joined: Jan 1970
Well, I am in to middle of changing the path, does anyone see anything wring with the existing code?
bja888 (not verified) posted this at 12:59 — 23rd March 2005.
They have: 5,633 posts
Joined: Jan 1970
Changed the code...
var objFS : Object = new ActiveXObject("Scripting.FileSystemObject");
var objTextS : Object = objFS.OpenTextFile("\\premfs18\sites\Premium18\bja888\database\wds.txt",1,false);
error...
link : http://www.oldbja888.com/oldbja888
Any password will show the error
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.