Answer the question
In order to leave comments, you need to log in
How to convert a file to text format?
In general, when receiving a file from outside the web server, I need to read its contents and write out the lines, but I cannot figure out how to write the resulting file into a variable and insert it into a textbox, for example, without saving it to the local disk.
The file format is not text!
Easier - for example, I downloaded the file and opened it in notepad, then I will see something like this in it:
ftypisom isomiso2avc1mp41
Code for receiving the file:
var response = request.Get("https://site.file.com/fileD=");
Answer the question
In order to leave comments, you need to log in
In general, I did not find how to display the box in the text, I immediately take the data and that's it.
var response = request.Get("https://site.file.com/fileD=");
Stream responseStream = response.ToMemoryStream();
using(StreamReader tmp = new StreamReader(responseStream))
{
string title = tmp.ReadToEnd().Substring("v:", "<");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question