473,320 Members | 1,829 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,320 software developers and data experts.

StreamWriter problem

Hello there,

I am having some problem with using StreamWriter object in aspnet
application. The thing is when i use the streamwriter in an aspnet page the
code gets executed fine but its terminating the session. I think this is a
know issues. I have given full rights to the aspnet user over the directory
in which the application tries to create a file and writes to that file,

thanks, Ramendra
Jan 17 '06 #1
5 1254
ramendra,

Do you have some code you could show us?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"ramendra" <ra******@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
Hello there,

I am having some problem with using StreamWriter object in aspnet
application. The thing is when i use the streamwriter in an aspnet page
the
code gets executed fine but its terminating the session. I think this is a
know issues. I have given full rights to the aspnet user over the
directory
in which the application tries to create a file and writes to that file,

thanks, Ramendra

Jan 17 '06 #2
Here is the piece of code that i am using to write to the file...

string strPath = Server.MapPath("bin");
strPath = strPath + "\\test.txt";
StreamWriter fs = new StreamWriter(strPath);

fs.WriteLine("testing");
fs.Flush();
fs.Close();

Keep in mind i have played around with all the basic things that would help
me solve the problem but it didn;t help.

I have also changed the security settings for the directory and gave full
control permission to the aspnet user.

thanks, Ramendra

"S. Justin Gengo [MCP]" wrote:
ramendra,

Do you have some code you could show us?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"ramendra" <ra******@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
Hello there,

I am having some problem with using StreamWriter object in aspnet
application. The thing is when i use the streamwriter in an aspnet page
the
code gets executed fine but its terminating the session. I think this is a
know issues. I have given full rights to the aspnet user over the
directory
in which the application tries to create a file and writes to that file,

thanks, Ramendra


Jan 17 '06 #3
Dan
When you say terminating the session what do you mean? Do you mean all your
session vars are being reset? Your browser is closing?

--
Dan
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:Oa**************@TK2MSFTNGP14.phx.gbl...
ramendra,

Do you have some code you could show us?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"ramendra" <ra******@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
Hello there,

I am having some problem with using StreamWriter object in aspnet
application. The thing is when i use the streamwriter in an aspnet page
the
code gets executed fine but its terminating the session. I think this is
a
know issues. I have given full rights to the aspnet user over the
directory
in which the application tries to create a file and writes to that file,

thanks, Ramendra


Jan 17 '06 #4
By terminating i mean all the session variables are lost. And, when debug and
if i put a break point inside the Session_End method the control returns to
this method.

"Dan" wrote:
When you say terminating the session what do you mean? Do you mean all your
session vars are being reset? Your browser is closing?

--
Dan
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:Oa**************@TK2MSFTNGP14.phx.gbl...
ramendra,

Do you have some code you could show us?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"ramendra" <ra******@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
Hello there,

I am having some problem with using StreamWriter object in aspnet
application. The thing is when i use the streamwriter in an aspnet page
the
code gets executed fine but its terminating the session. I think this is
a
know issues. I have given full rights to the aspnet user over the
directory
in which the application tries to create a file and writes to that file,

thanks, Ramendra



Jan 18 '06 #5
How exactly are you using a Streamwriter?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"ramendra" <ra******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
By terminating i mean all the session variables are lost. And, when debug
and
if i put a break point inside the Session_End method the control returns
to
this method.

"Dan" wrote:
When you say terminating the session what do you mean? Do you mean all
your
session vars are being reset? Your browser is closing?

--
Dan
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote
in
message news:Oa**************@TK2MSFTNGP14.phx.gbl...
> ramendra,
>
> Do you have some code you could show us?
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "ramendra" <ra******@discussions.microsoft.com> wrote in message
> news:21**********************************@microsof t.com...
>> Hello there,
>>
>> I am having some problem with using StreamWriter object in aspnet
>> application. The thing is when i use the streamwriter in an aspnet
>> page
>> the
>> code gets executed fine but its terminating the session. I think this
>> is
>> a
>> know issues. I have given full rights to the aspnet user over the
>> directory
>> in which the application tries to create a file and writes to that
>> file,
>>
>> thanks, Ramendra
>
>


Jan 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Hansen | last post by:
I am having a very strange problem with StreamWriter and writing to files. I have a procedure that is called several times to write out seperate files, each of them uniquely named by date all they...
1
by: Lars Hansen | last post by:
Hi This is probably pretty basic, but I have a problem with the access-level (local variable), when creating a new StreamWriter. I am trying to write some price information to a textfile - which...
13
by: Rob Corwin | last post by:
Hi, a c# app of mine that parses 30,000 xml files writes large amounts of data to file (> 2GB) using a streamwriter object (sw). everything works fine except that the memory used by the app grows...
5
by: Rob Corwin | last post by:
Hi, a c# app of mine that parses 30,000 xml files writes large amounts of data to flat file (> 2GB) using a streamwriter object (sw). everything works fine except that the memory used by the app...
5
by: Brendan Miller | last post by:
Hi, I have been having a problem writing the contents of a dataset to a .csv file. When I write to a .csv file and open it with either Excel or Wordpad the "french" characters are wrong. When I...
9
by: ShadowOfTheBeast | last post by:
Hi, I have got a major headache understanding streamReader and streamWriter relationship. I know how to use the streamreader and streamwriter independently. but how do you write out using the...
10
by: Oscar Thornell | last post by:
Hi, I generate and temporary saves a text file to disk. Later I upload this file to Microsoft MapPoint (not so important). The file needs to be in UTF-8 encoding and I explicitly use the...
2
by: gordon | last post by:
Hi, I am trying to create a reference to an external file to write to using stream writer and a value that is created in a for. Basically the value that a user will create will be the name...
4
by: Heron | last post by:
Hi, Could someone explain me why the following code doesn't work? The memorystream always remains with length 0. MemoryStream input = new MemoryStream();
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.