473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 1914
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: | last post by:
I am rewriting a C++ application in C#. This file has a combination of Text and Binary data. I used CFile before to read the text. If I hit a certain string that denotes the following data is...
1
by: Colin Green | last post by:
Hi I wonder if anyone has any ideas about this... I am dumping the contents of an XmlDocument into a RichTextBox so the user can see the raw XML. I use a line of code something like this to lado...
2
by: Keith Kingsley | last post by:
I'm using a StreamReader to read in several lines from an ASCII file. I'd like to know the StreamReader's "true" position-- that is, the number of bytes into the file that the StreamReader has...
3
by: Chan | last post by:
Got in a difficult situation of storing and retrieving TextReader in Cache, but found no such post yet. Tried to store a textreader into Cache object in a similar way illustrated in .NET's SDK...
2
by: Bryan Dickerson | last post by:
StreamReader says it is designed to read a stream of characters StringReader says it is designed to read a string TextReader says it is designed to read a sequential list of characters. I hate...
11
by: info | last post by:
Hi All, How can i rewind the following sile stream: TextReader tr = new StreamReader(File.Open(fileName, FileMode.Open)); Is there a dedicated method or shall I close and re-open the...
1
by: Rene | last post by:
Hi, I decided to take a closer look at the TextWriter and TextReader abstract classes just for fun. While poking around, I noticed that the TextWriter class includes an 'Encoding' property in...
3
by: Tony Johansson | last post by:
Hello! I just wonder in this specific case is it any advantage to use a TextReader a reference to a StreamReader ? Try { TextReader tr = new StreamReader(locationTextBox.Text); Try {
0
by: rajana | last post by:
Dear All, We have Ansi file with german characters (Ä / Ø) , We are using Streamreader to read the contents of the file. But Readline() not able to read the German characters. We tried all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.