BTW, I’m new at Visual C#.
I’ve already got the .txt file to upload, but after I get more familiar with Visual C#, my ultimate goal is to upload a .txt file into memory, read it, parse certain parts of data strings on it, and print the data onto the webpage.
I’ve been looking up and down the web (maybe I should learn more before I say I can’t find anything I can’t understand), but I’ve noticed on StackOverflow, the more specific you are, the more of a detailed answer you’re going to get.
I also noticed this question could be filed under a “show me teh codez”. As I am learning all this, instead of “show me teh codez”, I would perfer pointers in which direction I should go and how I should approach this.
Content in the .txt file
_______________________________
.RES B7=121
.RES C12=554
.RES VMAX=4.7μV
_______________________________
It goes on like this for about another 50 or .RES’s. I want to parse these under a while loop, but if there is a more efficient way to do so let me know.
What I want to do is parse the value before the “=” into a label, minus the “.RES ” (Don’t forget the space after it); and the value after the “=” into a textbox, all from a clk_btn event (in VS2010 Express, click on the button you wish to put it under in the design view and up pops the handler in the C# for it).
Remember, this is all from an uploaded text file. The file is uploaded directly into VS2010 Express’ default “WebApplication1” Folder on my desktop. Again, prefer not to “show me teh codez”, but give me pointers. Thanks folks.
If all lines start with “.RES ” you can use Substring to remove those. After that you could split the string on the “=” to get two tokens. One for the label and one for the text box. Create a label and set the appropriate value to the first of the two tokens. Create a textbox and set the appropriate property with the value of the second token. Add them both to the control collection of the parent control.
(Code omitted due to the explicit wish of not being shown the code)