ASP.net password system

They have: 5,633 posts

Joined: Jan 1970

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's picture

He has: 516 posts

Joined: Mar 2002

Try using an absolute path. You will have to ask the host for this.

-dk

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's picture

He has: 516 posts

Joined: Mar 2002

Well its the only other alternative.

-dk

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

That's weird. I've never had any problems with absolute paths.

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?

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...

Quote: ?
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.Runtime.InteropServices.COMException: ?

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.