Click here to Skip to main content
15,917,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 2:13
Yustme11-Mar-10 2:13 
GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 2:25
Kristian Sixhøj11-Mar-10 2:25 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 2:33
Yustme11-Mar-10 2:33 
GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 4:22
Kristian Sixhøj11-Mar-10 4:22 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 6:41
Yustme11-Mar-10 6:41 
QuestionNeed help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes10-Mar-10 23:48
suprsnipes10-Mar-10 23:48 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
OriginalGriff11-Mar-10 0:11
mveOriginalGriff11-Mar-10 0:11 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
peropata11-Mar-10 0:21
peropata11-Mar-10 0:21 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Keith Barrow11-Mar-10 0:31
professionalKeith Barrow11-Mar-10 0:31 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 1:37
mveRichard MacCutchan11-Mar-10 1:37 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 1:48
suprsnipes11-Mar-10 1:48 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
KenKen Wong11-Mar-10 2:10
KenKen Wong11-Mar-10 2:10 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 2:19
suprsnipes11-Mar-10 2:19 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
OriginalGriff11-Mar-10 3:57
mveOriginalGriff11-Mar-10 3:57 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 2:33
mveRichard MacCutchan11-Mar-10 2:33 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 2:58
suprsnipes11-Mar-10 2:58 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Keith Barrow11-Mar-10 3:15
professionalKeith Barrow11-Mar-10 3:15 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 4:37
mveRichard MacCutchan11-Mar-10 4:37 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 5:13
suprsnipes11-Mar-10 5:13 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 6:33
mveRichard MacCutchan11-Mar-10 6:33 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
DaveyM6911-Mar-10 8:26
professionalDaveyM6911-Mar-10 8:26 
You could cheat a little and use a list and it's sort method to help. Create the base list, add your value, sort it, get the index of your value and increment to get the next number up. Not very mathmatical or elegant (and probably inefficient) but it works.
C#
class Program
{
    static void Main(string[] args)
    {
        List<string> inputFromFile = new List<string>(3) {
                "4843", "4811", "4792" };
        int value = (int)4820f;
        List<int> list = inputFromFile.ConvertAll(
            new Converter<string, int>(StringToInt));
        list.Add(value);
        list.Sort();
        int index = list.IndexOf(value);
        if (index < (list.Count - 1))
            Console.WriteLine(list[index + 1]);
        else
            Console.WriteLine(value);
        Console.ReadKey();
    }

    private static int StringToInt(string text)
    {
        int result;
        int.TryParse(text, out result);
        return result;
    }
}
Dave

Binging is like googling, it just feels dirtier. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

QuestionWeb Service authentification server site Pin
olibara10-Mar-10 23:17
olibara10-Mar-10 23:17 
QuestionProblem with list with generic filter predicate. Pin
ddecoy10-Mar-10 22:47
ddecoy10-Mar-10 22:47 
AnswerRe: Problem with list with generic filter predicate. Pin
Keith Barrow10-Mar-10 23:31
professionalKeith Barrow10-Mar-10 23:31 
GeneralRe: Problem with list with generic filter predicate. Pin
ddecoy10-Mar-10 23:52
ddecoy10-Mar-10 23:52 

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.