Click here to Skip to main content
15,902,189 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Deploying windows application Pin
Zoltan Balazs29-Apr-08 1:46
Zoltan Balazs29-Apr-08 1:46 
GeneralReading data from a text file into an array one line at a time Pin
Grubious28-Apr-08 14:16
Grubious28-Apr-08 14:16 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Christian Graus28-Apr-08 14:29
protectorChristian Graus28-Apr-08 14:29 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Grubious28-Apr-08 15:22
Grubious28-Apr-08 15:22 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Grubious28-Apr-08 15:30
Grubious28-Apr-08 15:30 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Christian Graus28-Apr-08 18:01
protectorChristian Graus28-Apr-08 18:01 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Grubious28-Apr-08 19:57
Grubious28-Apr-08 19:57 
GeneralRe: Reading data from a text file into an array one line at a time Pin
Spacix One29-Apr-08 4:47
Spacix One29-Apr-08 4:47 
File.ReadAlllLines is the better option IF you are doing this on the standard framework and not the compact framework, because the compact framework doesn't contain this method.

If you are on the compact framework the above code isn't a good implementation of the StreamReader object, you should use a tryf statement or the simplier method of a using statement to the StreamReader object to finalize after execution.

Below is better (with the using statement) though you might want to check for End of File and other sorts also (which have not been added by me) Wink | ;)
private void importRates()
{
    string path = Settings.Default.FileName;
    if (!File.Exists(path))
    {
        MessageBox.Show("no file found at " + path);
        return;
    }
    int lineCount = 0;
    using (StreamReader sr = new StreamReader(path))
    {
        String line;
        while ((line = sr.ReadLine()) != null)
        {
            string[] ToFrom = line.Split(',');
            rates[lineCount, 0] = double.Parse(ToFrom[0]);
            rates[lineCount, 1] = double.Parse(ToFrom[1]);
            lineCount++;
        }
        sr.Close();
    }
}



-Spacix
All your skynet questions[^] belong to solved

GeneralSkins for Windows Forms Pin
Member 391904927-Apr-08 19:03
Member 391904927-Apr-08 19:03 
GeneralRe: Skins for Windows Forms Pin
Christian Graus27-Apr-08 21:12
protectorChristian Graus27-Apr-08 21:12 
GeneralRe: Skins for Windows Forms Pin
originSH28-Apr-08 0:53
originSH28-Apr-08 0:53 
GeneralRe: Skins for Windows Forms Pin
N a v a n e e t h28-Apr-08 1:07
N a v a n e e t h28-Apr-08 1:07 
GeneralRe: Skins for Windows Forms Pin
Member 391904928-Apr-08 9:53
Member 391904928-Apr-08 9:53 
GeneralRe: Skins for Windows Forms Pin
Pete O'Hanlon28-Apr-08 10:03
mvePete O'Hanlon28-Apr-08 10:03 
GeneralRe: Skins for Windows Forms Pin
Member 391904928-Apr-08 12:16
Member 391904928-Apr-08 12:16 
GeneralRe: Skins for Windows Forms Pin
Spacix One29-Apr-08 4:57
Spacix One29-Apr-08 4:57 
QuestionHow to implement a 30-day expiration / key-based registration for software Pin
Member 391904927-Apr-08 18:49
Member 391904927-Apr-08 18:49 
AnswerRe: How to implement a 30-day expiration / key-based registration for software Pin
Christian Graus27-Apr-08 21:11
protectorChristian Graus27-Apr-08 21:11 
GeneralRe: How to implement a 30-day expiration / key-based registration for software Pin
Member 391904928-Apr-08 9:56
Member 391904928-Apr-08 9:56 
GeneralRe: How to implement a 30-day expiration / key-based registration for software Pin
Christian Graus28-Apr-08 11:29
protectorChristian Graus28-Apr-08 11:29 
RantRe: How to implement a 30-day expiration / key-based registration for software Pin
Spacix One29-Apr-08 5:20
Spacix One29-Apr-08 5:20 
AnswerRe: How to implement a 30-day expiration / key-based registration for software Pin
Zoltan Balazs28-Apr-08 20:15
Zoltan Balazs28-Apr-08 20:15 
GeneralRe: How to implement a 30-day expiration / key-based registration for software Pin
Spacix One29-Apr-08 5:23
Spacix One29-Apr-08 5:23 
GeneralRe: How to implement a 30-day expiration / key-based registration for software Pin
Zoltan Balazs29-Apr-08 6:36
Zoltan Balazs29-Apr-08 6:36 
GeneralRe: How to implement a 30-day expiration / key-based registration for software Pin
Spacix One29-Apr-08 7:39
Spacix One29-Apr-08 7:39 

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.