All Questions
Tagged with streamwriter asp.net
63
questions
0
votes
1
answer
177
views
ASP.NET - HttpResponse.WriteAsync() vs HttpResponse.Body.WriteAsync() vs HttpResponse.BodyWriter.WriteAsync()
In ASP.NET one has three options (that I know of) for writing directly to the response buffer.
Given the following data:
var str = "Hello World";
var bytes = Encoding.UTF8.GetBytes(str);
We ...
0
votes
1
answer
118
views
Within a File StreamWriter scope how to get the Total lines counts in a file
How to do get the Total lines of the file when we are within in a StreamWriter scope.
Based on the total number of lines count I am writing some more lines at the end of the file.
I have tried the ...
0
votes
1
answer
276
views
How to create multiple CSV file in ASP .Net
I want to create multiple CSV file for every drop down Selected value. Even-though while debugging i can notice csv is appending for different drop down value but not writing another CSV file. do not ...
0
votes
1
answer
84
views
Where do I have to put the dispose()?
simple question cause I'm too dumb atm. I'm using streamreader and writer and it gives me the exception that the file is used by another process already. I know I have to set a .dispose() somewhere. ...
0
votes
0
answers
49
views
How do I replace a specific line in a textfile?
Good morning Stackoverflow,
I'm developing a time tracking web application with ASP.Net / C#.
There is a "coming" button that writes in a line of a textfile this: ID;Username;Date;Time.
At the ...
0
votes
2
answers
627
views
How do I write at a specific index of a line?
Good day Stackoverflow,
I want to write some text at a specific point of a line in a txt-file.
So I want to write something between two ; in the line.
The Line of the textfile is: 20180912_0149;KIV\...
0
votes
0
answers
24
views
asp.net overwriting files simultaneously
I have an asp.net website with a C# code-behind that, when processing, writes to a log file in the App_Data folder of the website, and also generates PDF files. Using StreamWriter class. Users ...
0
votes
0
answers
124
views
Creating new file based on web scrape then downloading to client's browser?
I am creating a website in Asp.Net and using it to scrape another webpage. My goal is to create a new file with the links of the scraped page. I am able to scrape the page successfully and print the ...
0
votes
1
answer
507
views
Writing the contents of a scraped page to a text file to download on client's browser
I am trying to figure out how to print the contents of a scraped web page to a downloadable .txt file on an Asp.Net web page. I currently am able to print the contents of this page to a label on the ...
2
votes
1
answer
1k
views
Correct way of streaming a CSV of unknown size from memory
I have a database that has a table with just over 2 million records of about 20 columns. The user is able to query the database and limit the number of records returned so the recordset may be from 1 ...
0
votes
3
answers
417
views
Can I ReadLock a file while I create/modify it using System.IO.File.WriteAllText() method?
I need to create a process that creates/modifies some text files in a folder. I am using below code to do that:
file = new System.IO.FileInfo(filePath);
file.Directory.Create();
System.IO.File....
0
votes
0
answers
55
views
Outputting .Css file asp.net
I am working on a asp.net webforms project. I wanted to know if it is possible to output a minified CSS file to my specific .aspx page. is it possible to do it with a stream writer class? Apologies if ...
2
votes
2
answers
256
views
"The process can not access the file '...' because it is being used by another process" when recreating temporary file for upload with FtpWebRequest
I am uploading a file on FTP. At first it works fine, but as soon as I click the upload button second time it throws an error
The process can not access the file '...' because it is being used by ...
0
votes
3
answers
764
views
System.IO.StreamWriter has no string constructor in .netcore 1.1
I'm taking my first baby steps in .NET Core V1.1 under VS2017 community edition.
I ported some chunks of code to an ASP.NET Core project that utilizes System.IO.StreamWriter:
string fileName = "...
0
votes
0
answers
428
views
Replacing a new line character with streamwriter remove everything after it. (ASP.NET, Json, C#)
I'm having an unexpected problem which I'm hoping one of you can help me with.
I have an ASP.NET Web API with a number of end points, one of which takes user input, received as JSON, and converts it ...