Web app and TextReader StreamReader

T

trint

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
 
B

Brad Wery

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
 
T

trint

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




- Show quoted text -

Thank you Brad...I will try this.
Trint
 
J

Jon Skeet [C# MVP]

trint said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top