Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How to read StreamReader text line by line

private static List<string> DownloadLines(string hostUrl)
    {

    List<string> strContent = new List<string>();

    var webRequest = WebRequest.Create(hostUrl);

    using (var response = webRequest.GetResponse())
    using (var content = response.GetResponseStream())
    using (var reader = new StreamReader(content))
        {
            while (!reader.EndOfStream)
            {
                strContent.Add(reader.ReadLine());
            }
        }

    return strContent;

}
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# list to string one line 
Csharp :: raycast unity 
Csharp :: pig sus 
Csharp :: c# wpf keyinput DeadCharProcessed 
Csharp :: ienumerator 
Csharp :: difference between namespace and assembly in c# 
Csharp :: c# require administrator permissions 
Csharp :: windows form textbox numbers only 
Csharp :: base64 bit string to pdf c# 
Csharp :: unity get scene index 
Csharp :: C# reflection invoke static generic method 
Csharp :: iterate through dictionary c# 
Csharp :: c# add item to a lsit 
Csharp :: c# 8 null coalescing assignment 
Csharp :: public static void Load 
Csharp :: c# date to string yyyy-mm-dd 
Csharp :: unity detect if version is a build or in editor 
Csharp :: how to open any file on button click in winforms 
Csharp :: using tmp unity 
Csharp :: xamarin timer example 
Csharp :: Oculus Unity add haptics 
Csharp :: check if current time is in the morning c# 
Csharp :: string from byte array c# 
Csharp :: unity get textmesh pro component 
Csharp :: c# request run as administrator 
Csharp :: how refresh just one table in laravel by terminal 
Csharp :: loop over all values in enum 
Csharp :: text split 
Csharp :: querymultiple dapper c# 
Csharp :: check distance to gameobject 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =