Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 07:29 AM
Anonymous
Guest
 
Posts: n/a
Default How to open a file in the current directory

Set fileSystem = Server.CreateObject( "Scripting.FileSystemObject" )
Set file = fileSystem.OpenTextFile( "config.xml", 1, False )

It's saying that 'config.xml' doesn't exist. How can I reference this file?
It's in the same directory as the file with the above code. Do I need to
build the path somehow?




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #2  
Old July 19th, 2005, 07:29 AM
Ray at
Guest
 
Posts: n/a
Default Re: How to open a file in the current directory

Set file = fileSystem.OpenTextFile(Server.MapPath("config.xml "), 1, False)

This assumes Windows 2000 or later.

Ray at home

--
Will trade ASP help for SQL Server help


"Anonymous" <Nobody> wrote in message news:3f32cf11_6@127.0.0.1...[color=blue]
> Set fileSystem = Server.CreateObject( "Scripting.FileSystemObject" )
> Set file = fileSystem.OpenTextFile( "config.xml", 1, False )
>
> It's saying that 'config.xml' doesn't exist. How can I reference this[/color]
file?[color=blue]
> It's in the same directory as the file with the above code. Do I need to
> build the path somehow?
>
>
>
>
> ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet[/color]
News==----[color=blue]
> http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000[/color]
Newsgroups[color=blue]
> ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption[/color]
=---


  #3  
Old July 19th, 2005, 07:29 AM
Curt_C [MVP]
Guest
 
Posts: n/a
Default Re: How to open a file in the current directory

Server.MapPath("config.xml")
Otherwise the FSO object is usually based out of C:\<windows>\System32\


--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Anonymous" <Nobody> wrote in message news:3f32cf11_6@127.0.0.1...[color=blue]
> Set fileSystem = Server.CreateObject( "Scripting.FileSystemObject" )
> Set file = fileSystem.OpenTextFile( "config.xml", 1, False )
>
> It's saying that 'config.xml' doesn't exist. How can I reference this[/color]
file?[color=blue]
> It's in the same directory as the file with the above code. Do I need to
> build the path somehow?
>
>
>
>
> ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet[/color]
News==----[color=blue]
> http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000[/color]
Newsgroups[color=blue]
> ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption[/color]
=---


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles