Click here to Skip to main content
15,902,635 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# Stream reader text file split line into first side int, and the other side string Pin
OriginalGriff29-Jul-18 6:09
mveOriginalGriff29-Jul-18 6:09 
QuestionCustom control not visible on parent control Pin
Ömer3328-Jul-18 11:30
Ömer3328-Jul-18 11:30 
AnswerRe: Custom control not visible on parent control Pin
Luc Pattyn28-Jul-18 13:17
sitebuilderLuc Pattyn28-Jul-18 13:17 
AnswerRe: Custom control not visible on parent control Pin
OriginalGriff28-Jul-18 20:24
mveOriginalGriff28-Jul-18 20:24 
AnswerRe: Custom control not visible on parent control Pin
Gerry Schmitz31-Jul-18 13:19
mveGerry Schmitz31-Jul-18 13:19 
Questionread text file online c# Pin
Luiz Carlos27-Jul-18 9:40
Luiz Carlos27-Jul-18 9:40 
AnswerRe: read text file online c# Pin
Dave Kreskowiak27-Jul-18 13:47
mveDave Kreskowiak27-Jul-18 13:47 
AnswerRe: read text file online c# Pin
OriginalGriff27-Jul-18 20:19
mveOriginalGriff27-Jul-18 20:19 
Text files don't have "lines" - they are just a stream of characters, where a specific character (or pair of characters, it's OS dependant) are interpreted by some functions as an "End of Line" character.

As such, the only ways to find "line 4" are to:
1) Read the whole text into a string and scan it for '\n' characters yourself.
2) Use the ReadLine methods provided with text streams to skip lines 1 to 3.
3) Read the whole text into an array of strings using the File.ReadAllLines method, and access each line via the array index.

But ... You are talking about "online" so it gets more complex: you can only read the file if you have access to it, and that means pretty much only on the computer that the software is running on. For C# in a website, that means the server not the client - C# does not run on the client at all, and server code has no direct access to client files.
You may have to bear this in mind when you design your system, as it will probably work in development (where the client and the server are the same physical computer) but fail spectacularly in production.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: read text file online c# Pin
Gerry Schmitz28-Jul-18 8:00
mveGerry Schmitz28-Jul-18 8:00 
QuestionGetting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 20:58
Wishingchain26-Jul-18 20:58 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Pete O'Hanlon26-Jul-18 22:45
mvePete O'Hanlon26-Jul-18 22:45 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 23:57
Wishingchain26-Jul-18 23:57 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 0:06
professionalEddy Vluggen27-Jul-18 0:06 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain27-Jul-18 18:04
Wishingchain27-Jul-18 18:04 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 23:47
professionalEddy Vluggen27-Jul-18 23:47 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain28-Jul-18 1:03
Wishingchain28-Jul-18 1:03 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen28-Jul-18 1:27
professionalEddy Vluggen28-Jul-18 1:27 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
CP_Member88829-Jul-18 19:25
CP_Member88829-Jul-18 19:25 
QuestionPlotting a line graph in c# and retaining the previous graphs. Pin
Dipk1123-Jul-18 0:51
Dipk1123-Jul-18 0:51 
AnswerRe: Plotting a line graph in c# and retaining the previous graphs. Pin
OriginalGriff23-Jul-18 2:04
mveOriginalGriff23-Jul-18 2:04 
GeneralRe: Plotting a line graph in c# and retaining the previous graphs. Pin
Dipk1123-Jul-18 20:52
Dipk1123-Jul-18 20:52 
GeneralRe: Plotting a line graph in c# and retaining the previous graphs. Pin
Gerry Schmitz24-Jul-18 10:27
mveGerry Schmitz24-Jul-18 10:27 
Questioncreate separate XML file based on html tags in a string in C# Pin
sudipta saha20-Jul-18 19:40
sudipta saha20-Jul-18 19:40 
AnswerRe: create separate XML file based on html tags in a string in C# Pin
Eddy Vluggen20-Jul-18 23:46
professionalEddy Vluggen20-Jul-18 23:46 
AnswerRe: create separate XML file based on html tags in a string in C# Pin
Gerry Schmitz22-Jul-18 8:59
mveGerry Schmitz22-Jul-18 8:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.