Questions tagged [streamreader]
StreamReader is a C# class designed for character input in a particular encoding, it can be used for reading lines of information from a standard text file. By default, a StreamReader is not thread safe.
streamreader
1,951
questions
0
votes
0
answers
47
views
Parsing standalone if, and if-else statements deterministically and adding to a total count c#
I am looking to create a method that will start a reader(likely StreamReader) on a c# .cs source file, and it will be able to parse through and locate all instances of "if" statements, ...
0
votes
1
answer
56
views
Read lines of Txt file, edit specific lines, then write full Txt file to new file - C#
I'd like to read a Txt file with parameters and values then update the values of specific parameters. I don't know the original value of the parameter before changing but have a list of parameter ...
0
votes
0
answers
69
views
Can not read StreamReader correctly
I have a middleware to read the request and response as follows
public class FooMiddleware
{
private readonly RequestDelegate _next;
public FooMiddleware(RequestDelegate next)
{
...
0
votes
1
answer
52
views
Renci SSH.NET hangs on simple command and response
Using Renci SSH.NET, I am trying to send a simple command to an ethernet switch over ssh, and then to read the response back from the switch. I can connect to the switch but it just hangs when I call ...
0
votes
1
answer
34
views
Why my StreamReader blocks the program when using it with NetworkStream c#?
I am trying to make simple tcp chat but instead of NetworkStream.Read(buffer, 0, buffersize) I wanted to use StreamReader as I saw it being used in a video. Well I tried using ReadLine() and reader....
0
votes
1
answer
43
views
checking on whether a streamreader is open gives a warning in VB.net
This scheme
Try
SR= New StreamReader(...)
Catch ex As Exception
MsgBox(ex.Message, vbOK, "Error opening File")
GoTo wrapup
End Try
... {do things}
...
0
votes
1
answer
48
views
I am trying to create an application in .NetForms where I read data from a file and then use that data to truncate a chart
Currently I am reading the data from a csv file and displaying it in a textbox on one form. Then I am aiming to pass that data to another form where I can create a visualisation as a column chart ...
0
votes
0
answers
31
views
.Net 6 StreamReader.ReadBlockAsync throw System.ObjectDisposedException when reading file
I have a problem when trying to read a file from an FTP server. Thousands of files have been read without problem. This problem only occurs for 1 file. The problem occurs when I use the method ...
0
votes
0
answers
20
views
NamedPipeClientStream stalls after the first ReadLineAsync, and stalls on the first WriteLineAsync
I chose NamedPipes over TCP because I needed two applications on the same machine to talk to each other. I wanted exceedingly simple, quick, and easy, unfortunately it has proven to be the opposite.
...
0
votes
1
answer
86
views
Read POST Request body in Web API is adding an extra slash to '\t'
We have a requirement in which for a certain rest call, we need to intercept the request before getting it to the controller and add something to the request body. I am able to do that using an ...
0
votes
0
answers
24
views
How do you change the background color of the < td > tag from vb.net to an html file?
I'm reading an file .html from vb.net using streamreader to replace some variable declared in .html file as @var1, @var2 etc.
They work fine, but I also need to change the background color to the tag,...
0
votes
0
answers
33
views
Reading (and Writing) multiple Matrices to a stream in MathNet
I have an array of MathNet matrices, and I want to write them to a single file and also read them back as multiple matrices.
When I try and read them from files it always throws an invalid string ...
0
votes
2
answers
98
views
VB.NET - Substring Function Doesn't Work Correctly
I have a file in the project called this.txt. This file contains Coordinates of a drawing.
In each line in the file , there are 4 values. Between each value , There is a character separating the ...
0
votes
1
answer
83
views
Azure Logic Apps / Azure Function : Truncate Body when i do a reader Of a HTTPRequest body
I have an azure logic apps and i use an azure function to calculate the SHA256 of a PDF file that i previously dowloaded from an another software (API REST).
My problem is that the result of the ...
1
vote
1
answer
79
views
StreamReader Correct way to read whole file without locking a file?
I am trying to read out of a license file written in xml in a way that will not lock the file in case the application happens to check at the same time. I have based the below code off of these two ...