Click here to Skip to main content
15,898,010 members
Home / Discussions / C#
   

C#

 
AnswerRe: Bypass character in textbox Pin
Edwin Syarief8-Aug-07 21:27
Edwin Syarief8-Aug-07 21:27 
QuestionUpdating DataSet Pin
-BoBo8-Aug-07 17:29
-BoBo8-Aug-07 17:29 
AnswerRe: Updating DataSet Pin
hamid_m8-Aug-07 19:23
hamid_m8-Aug-07 19:23 
Questiondouble buffering for flickering problem Pin
cyn88-Aug-07 17:10
cyn88-Aug-07 17:10 
AnswerRe: double buffering for flickering problem Pin
Martin#8-Aug-07 20:26
Martin#8-Aug-07 20:26 
AnswerRe: double buffering for flickering problem Pin
Luc Pattyn9-Aug-07 1:04
sitebuilderLuc Pattyn9-Aug-07 1:04 
QuestionFormula - How many address in a range Pin
StevenWalsh8-Aug-07 17:01
StevenWalsh8-Aug-07 17:01 
AnswerRe: Formula - How many address in a range Pin
Christian Graus8-Aug-07 17:29
protectorChristian Graus8-Aug-07 17:29 
One presumes you need to take an IP address, split it into four numbers, and check if each of those numbers is within the ranges specified by doing the same to your range IP addresses.

string [] lower = "10.126.0.1".Split(new char [] {'.'} );
string [] upper= "10.127.0.1".Split(new char [] {'.'} );

string [] range = newIp.Split(new char[] {'.'} );

// check here that range contains 4 strings

bool match = true;

for(int i=0;i<4;++i)
{
match &= (int.TryParse(lower[i]) >= int.TryParse(range[i]));
match &= (int.TryParse(upper[i]) <= int.TryParse(range[i]));
}

Something like that would work, but it has levels of nastiness.

1 - it assumes the values coming in are all valid numbers. Using TryParse would add a lot of code, you could add a try/catch ( if it blows up, they can't match ).

2 - it parses range[i] twice, instead of storing it.

But, it should work, and should give you a good starting point. Assuming my assumptions about the rules that define a number being 'in the range' are correct.


Christian Graus - Microsoft MVP - C++

"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: Formula - How many address in a range Pin
StevenWalsh8-Aug-07 18:05
StevenWalsh8-Aug-07 18:05 
GeneralRe: Formula - How many address in a range Pin
Christian Graus8-Aug-07 18:54
protectorChristian Graus8-Aug-07 18:54 
AnswerRe: Formula - How many address in a range Pin
Luc Pattyn9-Aug-07 1:35
sitebuilderLuc Pattyn9-Aug-07 1:35 
GeneralRe: Formula - How many address in a range Pin
StevenWalsh9-Aug-07 1:45
StevenWalsh9-Aug-07 1:45 
QuestionXML in a rich text box Pin
RussBus8-Aug-07 10:08
RussBus8-Aug-07 10:08 
AnswerRe: XML in a rich text box Pin
Big Daddy Farang8-Aug-07 11:51
Big Daddy Farang8-Aug-07 11:51 
AnswerRe: XML in a rich text box Pin
Hessam Jalali8-Aug-07 17:10
Hessam Jalali8-Aug-07 17:10 
Questionbest way to program a huge xml file Pin
brsecu8-Aug-07 9:52
brsecu8-Aug-07 9:52 
AnswerRe: best way to program a huge xml file Pin
Judah Gabriel Himango8-Aug-07 10:36
sponsorJudah Gabriel Himango8-Aug-07 10:36 
GeneralRe: best way to program a huge xml file Pin
brsecu8-Aug-07 10:47
brsecu8-Aug-07 10:47 
GeneralRe: best way to program a huge xml file Pin
Judah Gabriel Himango8-Aug-07 18:18
sponsorJudah Gabriel Himango8-Aug-07 18:18 
GeneralRe: best way to program a huge xml file Pin
brsecu9-Aug-07 5:20
brsecu9-Aug-07 5:20 
AnswerRe: best way to program a huge xml file Pin
Jimmy Zhang23-Aug-09 13:21
Jimmy Zhang23-Aug-09 13:21 
Questionentering data in same row inmore than one attempt Pin
richieis8-Aug-07 9:40
richieis8-Aug-07 9:40 
AnswerRe: entering data in same row inmore than one attempt Pin
Judah Gabriel Himango8-Aug-07 10:30
sponsorJudah Gabriel Himango8-Aug-07 10:30 
GeneralRe: entering data in same row inmore than one attempt Pin
richieis9-Aug-07 8:11
richieis9-Aug-07 8:11 
QuestionPoint Cloud Rotation Pin
GreenGiant838-Aug-07 8:58
GreenGiant838-Aug-07 8:58 

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.