Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2007

Tip: Looking for answers? Try searching our database.

Web app and TextReader StreamReader

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
trint - 20 Aug 2007 18:49 GMT
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
Brad Wery - 20 Aug 2007 18:58 GMT
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

> When testing locally with:
> TextReader tr = new StreamReader(@"C:\gcc.set");
[quoted text clipped - 5 lines]
> Thanks,
> Trint
trint - 20 Aug 2007 19:03 GMT
> Put the file in the same directory as the application and change your
> call to look like this:
[quoted text clipped - 14 lines]
>
> - Show quoted text -

Thank you Brad...I will try this.
Trint
Jon Skeet [C# MVP] - 20 Aug 2007 19:04 GMT
> When testing locally with:
> TextReader tr = new StreamReader(@"C:\gcc.set");
[quoted text clipped - 3 lines]
> 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?

Signature

Jon Skeet - <skeet@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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.