Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to run a process forever Pin
Dave Kreskowiak21-Mar-10 7:09
mveDave Kreskowiak21-Mar-10 7:09 
QuestionCOM exception unhandled Pin
sindhumahe18-Mar-10 20:19
sindhumahe18-Mar-10 20:19 
QuestionImporting data from an Excel Doc Pin
Gold_Dark18-Mar-10 19:32
Gold_Dark18-Mar-10 19:32 
AnswerRe: Importing data from an Excel Doc Pin
SeMartens18-Mar-10 21:22
SeMartens18-Mar-10 21:22 
GeneralRe: Importing data from an Excel Doc Pin
Gold_Dark18-Mar-10 21:27
Gold_Dark18-Mar-10 21:27 
QuestionHow to remove the Highlight blue colour in list box Pin
Joe Rozario18-Mar-10 18:32
Joe Rozario18-Mar-10 18:32 
AnswerRe: How to remove the Highlight blue colour in list box Pin
Joe Rozario18-Mar-10 19:47
Joe Rozario18-Mar-10 19:47 
QuestionUsing textfile as a storage system for numerical data... Pin
sebogawa18-Mar-10 16:34
sebogawa18-Mar-10 16:34 
Hi,
Im trying to find out the simplest way to store variable values in a file (text or otherwise), as well as being able to read specific areas of the file in order to retrive the values and implement them into a windows form control like a textbox or something. The StreamReader and StreamWriter class works but I dont know how to read specific lines like line number 4 or so. Here is my code:

<pre>

StreamReader sr = new StreamReader("configFile.txt", System.Text.Encoding.Default);
string s = null;

while ((s = sr.ReadLine()) != null)
{
if (s.IndexOf("Name:") != -1)
{

// textBox1.text = s;
break;
}
}

sr.Close();


</pre>

The issue is that I cant select what to search for by line number. All i need is a simple way to add textbox values to a text file where each texbox has its own line in the text file, and I can call up the text file at a certain line of the file and read the contents/make it the textbox text. The data is numerical. I came across hash tables but I do not know how to implement them/save them to a file.
AnswerRe: Using textfile as Pin
RCoate18-Mar-10 16:40
RCoate18-Mar-10 16:40 
GeneralRe: Using textfile as Pin
sebogawa18-Mar-10 16:45
sebogawa18-Mar-10 16:45 
AnswerRe: Using textfile as a storage system for numerical data... Pin
Luc Pattyn18-Mar-10 16:51
sitebuilderLuc Pattyn18-Mar-10 16:51 
GeneralRe: Using textfile as a storage system for numerical data... Pin
sebogawa18-Mar-10 17:28
sebogawa18-Mar-10 17:28 
GeneralRe: Using textfile as a storage system for numerical data... Pin
Luc Pattyn18-Mar-10 17:38
sitebuilderLuc Pattyn18-Mar-10 17:38 
GeneralRe: Using textfile as a storage system for numerical data... Pin
sebogawa18-Mar-10 17:50
sebogawa18-Mar-10 17:50 
GeneralRe: Using textfile as a storage system for numerical data... Pin
sebogawa18-Mar-10 22:43
sebogawa18-Mar-10 22:43 
GeneralRe: Using textfile as a storage system for numerical data... Pin
Luc Pattyn19-Mar-10 3:03
sitebuilderLuc Pattyn19-Mar-10 3:03 
QuestionMicrosoft.Exchange.WebServices Question Pin
RCoate18-Mar-10 13:56
RCoate18-Mar-10 13:56 
AnswerRe: Microsoft.Exchange.WebServices Question Pin
RCoate21-Mar-10 17:09
RCoate21-Mar-10 17:09 
AnswerRe: Microsoft.Exchange.WebServices Question Pin
alisonstang229-Jul-11 4:38
alisonstang229-Jul-11 4:38 
Questionappend node by element name Pin
Jassim Rahma18-Mar-10 11:43
Jassim Rahma18-Mar-10 11:43 
AnswerRe: append node by element name Pin
Not Active18-Mar-10 12:10
mentorNot Active18-Mar-10 12:10 
AnswerRe: append node by element name Pin
carlecomm18-Mar-10 15:44
carlecomm18-Mar-10 15:44 
AnswerRe: append node by element name Pin
Mirko198018-Mar-10 22:27
Mirko198018-Mar-10 22:27 
QuestionHow do I call a method on the parent form from another form? Pin
Paul Stol18-Mar-10 10:09
Paul Stol18-Mar-10 10:09 
AnswerRe: How do I call a method on the parent form from another form? Pin
T M Gray18-Mar-10 10:46
T M Gray18-Mar-10 10:46 

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.