473,804 Members | 3,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1938
Put the file in the same directory as the application and change your
call to look like this:

TextReader tr = new StreamReader(Se rver.MapPath("g cc.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 <bradweryatgmai l.comwrote:
Put the file in the same directory as the application and change your
call to look like this:

TextReader tr = new StreamReader(Se rver.MapPath("g cc.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.co m>
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
519
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 binary, I used the current position in the file and another stream to read to the binary data. All text data is ended with a carriage return / line feed while the binary is actually an image file listed byte by byte. Preceding the binary data...
1
2555
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 the Xml text into the textbox: richTextBox.Text = xmlDoc.ToString(); I recon this technique is inefficient with large xml documents.
2
13006
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 read. I thought about using MyStreamReader.BaseStream.Position, but this always seems to return a multiple of the StreamReader's buffer size (which seems natural-- as I understand it the StreamReader reads from the underlying stream in discrete...
3
1460
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 doc ("Retrieving Values of Cached Items"): ' ----------------------------- ... Dim CPCache As textreader = CType(Cache("CP"), textreader) If CPCache Is Nothing Then ...
2
16309
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 to sound like a VB6 grump, but aren't we splitting hairs?? What's the difference? -- TFWBWY...A
11
12661
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 file...
1
6200
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 its definition. To me, this sounds very logical because the TextWriter is all about writing text and sooner or later you will need to use a type of encoding that specifies how to write (persist) the text.
3
3733
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
2365
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 possibilities of calling the streamreader, but nothing worked. Dim sr As StreamReader = New StreamReader(Filename, System.Text.Encoding.Default, True) Dim sr As StreamReader = New StreamReader(Filename, _System.Text.Encoding.ASCII, False, 512)
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.