471,337 Members | 988 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Web app and TextReader StreamReader

When testing locally with:
TextReader tr = new StreamReader(@"C:\gcc.set");
Now that I have uploaded this to the server on the net,
that locations permissions are denied.
How can I change this to work with StreamReader on the Web
or do I have to use a different function?
Any help is appreciated.
Thanks,
Trint

Aug 20 '07 #1
3 1822
Put the file in the same directory as the application and change your
call to look like this:

TextReader tr = new StreamReader(Server.MapPath("gcc.set"));

Brad

trint wrote:
When testing locally with:
TextReader tr = new StreamReader(@"C:\gcc.set");
Now that I have uploaded this to the server on the net,
that locations permissions are denied.
How can I change this to work with StreamReader on the Web
or do I have to use a different function?
Any help is appreciated.
Thanks,
Trint
Aug 20 '07 #2
On Aug 20, 1:58 pm, Brad Wery <bradweryatgmail.comwrote:
Put the file in the same directory as the application and change your
call to look like this:

TextReader tr = new StreamReader(Server.MapPath("gcc.set"));

Brad

trint wrote:
When testing locally with:
TextReader tr = new StreamReader(@"C:\gcc.set");
Now that I have uploaded this to the server on the net,
that locations permissions are denied.
How can I change this to work with StreamReader on the Web
or do I have to use a different function?
Any help is appreciated.
Thanks,
Trint- Hide quoted text -

- Show quoted text -
Thank you Brad...I will try this.
Trint

Aug 20 '07 #3
trint <tr***********@gmail.comwrote:
When testing locally with:
TextReader tr = new StreamReader(@"C:\gcc.set");
Now that I have uploaded this to the server on the net,
that locations permissions are denied.
How can I change this to work with StreamReader on the Web
or do I have to use a different function?
Any help is appreciated.
How much access to you have on the server? Can you give the server user
permission to read the file?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Aug 20 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Colin Green | last post: by
2 posts views Thread by Keith Kingsley | last post: by
3 posts views Thread by Chan | last post: by
2 posts views Thread by Bryan Dickerson | last post: by
3 posts views Thread by Tony Johansson | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.