|
There's really two questions you seem to be confusing here. The first is "which IPs are valid within a range", and "which IPs are used by computers".
The first question can be solved mathematically, but it won't tell you anything about your actual network. The second question can only be solved by sending a ping or ARP packet out for each address, and checking for a response. Whether a machine is disconnected or simply nonexistant really is the same thing as far as network is concerned, so there's no way (or reason) to differentiate between the two.
If you want to know which addresses within a range of IPs have computers associated, ping each one. It's tedious, but it's the only way. You'll obvously only want to scan a small range of addresses, or you'll be at it for hours.
|
|
|
|
|
Thx for the reply tylerl.
I was hoping there was some other way to find out which IPs are used by computers besides pinging each one.
I don't know if you have used Look@Lan, but somehow it figures out which IPs are used by computers and which IPs just don't exist. I've tried looking around the net for the program's source code but even though its free, the source code is unavailable. I've also looked at quite a few ping applications in c# but they still can't differentiate between an IP that is being used by a computer or one that doesn't exist on the network. They just send a packet and check for a reply.
If you can think of anything else, please don't hesitate to reply back.
Thanks again.
|
|
|
|
|
Pinging is no longer much help. Unless you turn on the File Sharing exception for Windows Firewall in XP SP2, or otherwise open port 445, Windows Firewall will reject ICMP Echo Request packets sent by ping , by default. You can enable them if required. You'll find that most other software firewalls will do the same.
If you need to determine whether you can connect to a network service, just try to connect to it. If you're trying to do a site survey you're probably out of luck.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
What is the best way to create one in C#?
I guess I need to create a tuple class or is there something like SortedList for tuples?
Later, JoeSox
"Football is a game of cliches, and I believe in every one of them." -Vincent Lombardi
CPMCv1.0 ↔ humanaiproject.org ↔ Last.fm
|
|
|
|
|
what do you mean by tuple, can you give an example? If you mean a variable that holds two values, you can easily use a struct or class
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote: what do you mean by tuple, can you give an example?
Well, I am experimenting with this right now
<br />
class Tuple<br />
{<br />
private string relationship;<br />
private string phrase1;<br />
private string phrase2;<br />
<br />
public string Relationship<br />
{<br />
get { return relationship; }<br />
set { relationship = value; }<br />
}<br />
public string Phrase1<br />
{<br />
get { return phrase1; }<br />
set { phrase1 = value; }<br />
}<br />
public int Phrase2<br />
{<br />
get { return phrase2; }<br />
set { phrase2 = value; }<br />
}<br />
}<br />
I might change it to objects instead of strings. I just need something that will be fast for searching and sorting it's data. SortedList works great but that is only for a (key,value) not (key, value, value).
Later, JoeSox
"Football is a game of cliches, and I believe in every one of them." -Vincent Lombardi
CPMCv1.0 ↔ humanaiproject.org ↔ Last.fm
|
|
|
|
|
That's okay. The easiest way is to implement IComparable in your Tuple class. The SortedList will then sort your keys according to the result of the CompareTo function of your Tuple class.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks. I'll play around with that idea.
Later, JoeSox
"Football is a game of cliches, and I believe in every one of them." -Vincent Lombardi
CPMCv1.0 ↔ humanaiproject.org ↔ Last.fm
|
|
|
|
|
|
Kevin McFarlane wrote: If you're using .NET 2.0 then a Tuple class (actually a Triple)is provided by the free PowerCollections library.
Outstanding. Thanks.
Later, JoeSox
"Football is a game of cliches, and I believe in every one of them." -Vincent Lombardi
CPMCv1.0 ↔ humanaiproject.org ↔ Last.fm
|
|
|
|
|
Actually, I just discovered that there are Pair and Triplet classes of Objects in .NET 1.1 but they're in System.Web.UI. Surprised they didn't update them to generic versions and put them in the generics namespace. However, I expect they'll roll in some of the PowerCollections stuff over time.
Kevin
|
|
|
|
|
|
Has anybody ever drawn the red squigly lines that show up say in Word or other apps under a word when it is misspelled?
I have come up with a way but it is not reliable to underline all words. My method gets messed up with tab chars and also hidden text. I suspect the same would be true for tables and inserted pictures.
Thanks in advance,
Eric
|
|
|
|
|
From my knowledge, it is not directly possible to use the rtb class to draw the Office-Style underlines.
However, you can have an effective selection method by saving the selected text and creating custom functions to get text from it - even with hidden text
|
|
|
|
|
I think you would probably have to directly draw the lines on the control, either using RichTextBox.CreateGraphis() or by creating a class that inherits from RichTextBox, and overriding RichtextBox.OnPaint
|
|
|
|
|
Its possible to draw the line using the approach mentioned. However, the difficulty I'm having is reliably calculating the coordinates of the beginning of the word that needs to be marked with the squiggly.
Any suggestions there?
Thanks again,
Eric
|
|
|
|
|
Use the GetPositionFromCharIndex method.
|
|
|
|
|
Will u please post the code!!!!!!!!
|
|
|
|
|
Hi!
The Rich Edit control that's actually the core control underneath the RichTextBox can display underlines (even the squiggly ones), but setting the corresponding character styles is not possible directly with the regular RichTextBox.
You'll have to send EM_SETCHARFORMAT messages to the rtb to enable underlining in a given style. You can't have an underline color that's different from the text foreground color, though.
You might want to look up the CHARFORMAT2 structure in the Platform SDK documentation on the different options you have to underline text within a rich edit control (and thus in a RichTextBox).
Regards,
mav
-- modified at 7:47 Saturday 4th February, 2006
Just found out that my statement on the underline color was incorrect.
You CAN have different underline colors, althouth it's not documented in the CHARFORMAT2 struct. The upper 4 bits of the bUnderlineType determine the color.
|
|
|
|
|
Hi everyone!!!
I want to add SplashScreen to my application. I found on the Web a source to do : http://www.reflectionit.nl/Splash.aspx
To give more promptness to this SplashScreen, I have to add a Flash 8 control (OCX Flash). There I have problem on execution. The error message :
Impossible to reach a removed object named "SplashForm"
Is there solution!!!
Thank you!!!
C# Forever !!!
|
|
|
|
|
Try making a new project, and copying all your existing source into it
|
|
|
|
|
Hi James Gupta and thanx for reply !!!
That what I have done, but there is always same problem !!!
I don't know if you you've seen the code source of the application (URL : http://www.reflectionit.nl/Splash.aspx). The problem is only when I add a Flash OCX control (Flash8.ocx) to the SplashForm , else, I have not this problem.
Thanx!!!
|
|
|
|
|
Hello, does anyone know how to use DrawString / DoubleBuffer / UserPaint / AllPaintingInWmPaint to paint your own RichTextBox? This is for a news ticker that contains multiple fonts, font colors and embedded images. The autoscrolling is working great, but the flicker is really bad and I was told that double buffering is the way to go (is it, or is there something else, like making an image and double buffering its movement??). Any pointers would be really appreciated!
|
|
|
|
|
You could override the RichTextBox class, and in the constructor:
<br />
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);<br />
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);<br />
|
|
|
|
|
Is it possible to fire two events at the same time?
In my code I fire off an event if my if statement is true (see code below)
<br />
if (SegType == "Y")if(OnQResponse != null) OnQResponse(this, new EventArgs());<br />
Could I add the other event in this statement? Like: if(SegType == "Y") if(OnQResponse != null && OnDataRecvd != null){OnQResponse(this, new EventArg()); OnDataRecvd(this, new EventArg());
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|