StreamWriter problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
When you say terminating the session what do you mean? Do you mean all your
session vars are being reset? Your browser is closing?
 
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.
 
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.
 

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

Back
Top