Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
QuestionMulti-Connection Problem Pin
kornkimhour29-Nov-11 15:50
kornkimhour29-Nov-11 15:50 
AnswerRe: Multi-Connection Problem Pin
PIEBALDconsult29-Nov-11 17:50
mvePIEBALDconsult29-Nov-11 17:50 
Questionip iterator code challenge Pin
acecase29-Nov-11 9:41
acecase29-Nov-11 9:41 
AnswerRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 10:04
Ian Shlasko29-Nov-11 10:04 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 14:16
acecase29-Nov-11 14:16 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 15:04
Ian Shlasko29-Nov-11 15:04 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 15:49
acecase29-Nov-11 15:49 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 16:12
Ian Shlasko29-Nov-11 16:12 
Deceptive? Hardly...

C#
foreach (string component in tokens[index].Split(','))
{
  if (component.Contains('-'))
  {
    string[] range = component.Split('-');
    if (range.Length != 2) throw new ArgumentException();
    int startRange, endRange;
    if (int.TryParse(range[0], out startRange) && int.TryParse(range[1], out endRange) && startRange <= endRange)
      for (int x = startRange; x <= endRange; x++)
        foreach (IPAddress addr in ParseIPAddressRange(tokens, index + 1, partial + "." + x.ToString()))
          yield return addr;
    else
      throw new ArgumentException();
  }
  else if (component.Contains('/')
  {
    // You should really be able to figure out the /xx notation on your own, given the above block.
  }
}

Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 16:46
acecase29-Nov-11 16:46 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 17:00
Ian Shlasko29-Nov-11 17:00 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 17:02
acecase29-Nov-11 17:02 
GeneralRe: ip iterator code challenge Pin
acecase30-Nov-11 6:59
acecase30-Nov-11 6:59 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko30-Nov-11 7:09
Ian Shlasko30-Nov-11 7:09 
AnswerRe: ip iterator code challenge Pin
BillWoodruff29-Nov-11 12:50
professionalBillWoodruff29-Nov-11 12:50 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 14:25
acecase29-Nov-11 14:25 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 14:29
acecase29-Nov-11 14:29 
QuestionDate.Subtract is calculating incorrectly Pin
indian14329-Nov-11 8:24
indian14329-Nov-11 8:24 
AnswerRe: Date.Subtract is calculating incorrectly Pin
OriginalGriff29-Nov-11 8:44
mveOriginalGriff29-Nov-11 8:44 
GeneralRe: Date.Subtract is calculating incorrectly Pin
Luc Pattyn29-Nov-11 14:35
sitebuilderLuc Pattyn29-Nov-11 14:35 
AnswerRe: Date.Subtract is calculating incorrectly Pin
Ian Shlasko29-Nov-11 10:11
Ian Shlasko29-Nov-11 10:11 
AnswerRe: Date.Subtract is calculating incorrectly Pin
jschell30-Nov-11 10:21
jschell30-Nov-11 10:21 
QuestionC# Execution of Java program Pin
Jerry W. Manweiler, Ph.D.29-Nov-11 7:11
Jerry W. Manweiler, Ph.D.29-Nov-11 7:11 
SuggestionRe: C# Execution of Java program Pin
RaviRanjanKr29-Nov-11 8:30
professionalRaviRanjanKr29-Nov-11 8:30 
AnswerRe: C# Execution of Java program Pin
Not Active29-Nov-11 8:42
mentorNot Active29-Nov-11 8:42 
QuestionRe: C# Execution of Java program Pin
Jerry W. Manweiler, Ph.D.29-Nov-11 9:59
Jerry W. Manweiler, Ph.D.29-Nov-11 9: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.