|
Hello everyone,
I am currently trying to code a little Subnetting-Calc, trying to get as close to .NET-Standards as I can (and thus, get some practise with .NET-Standards).
One thing I want to do is to return a networks broadcast-address based on Client IP and subnet-mask.
I have a method getBroadcastAddressAsLong (which accepts 2 Params representing SubnetMask and Client-IP and returns the BroadcastAddress as LONG).
During testing, I first wanted to try if the IP-Addresses were valid, so I tried to create 2 IPAddresses which should be identical, one long (0xFFFFFF00) and one byte[] (0,255,255,255) and passed them to the IPAddress Constructor.
Unfortunatley, the byte[] constructor fails, throwing an ArgumentException with the "additional info: addres" (sic!).
That really does not help much, so it would be great if someone could tell me, what to pass along to get that byte[] constructor to work".
Version of .NET FW is 1.1 SP1
Cheers
Sid
|
|
|
|
|
sebs2004 wrote:
one long (0xFFFFFF00) and one byte[] (0,255,255,255) and passed them to the IPAddress Constructor.
Those are definitaly not the same.... try byte[] { 255,255,255,0 } instead...
xacc-ide 0.0.12 now with C#, MSIL, C, XML, ASP.NET and HLSL coloring - Screenshots
|
|
|
|
|
Thats something I forgot to mention:
I did try that.
If I supply the long (0xFFFFFF00), it works. If I call getAddressBytes on that Address, I get a byte[] with {0,255,255,255}.
Thats why I switched to the different Byteorder. I thought I might fail because it expects the byte[] with highest lowest byte first.
Nonetheless, it neither works with 0,255,255,255 nor with 255,255,255,0
Cheers
Sid
|
|
|
|
|
i get this same issue.
does anyone have any idea how to resolve it?
|
|
|
|
|
Hi all!!
I'm trying to compile a code downloaded from the internet. It's an example of using sockets in .Net Framework. The problem is than when I tried to execute it, an error appears saying:
"Failed to stablish a connection as the destination computer has refused this connection"
The last sentence is a translation of the spanish one that appears on my computer.. it won't be exacty the same for english systems.
I suppose I have to kind of open the socket or something but I don't know what.
Any one knows what should I do?
Thanks!!
|
|
|
|
|
|
Check to make sure that any firewall running on the server machine (even if it's the local machine) is allowing connections on whatever port your using.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I've got a datagrid.
I have a function which selects certain rows in a datagrid thus:
public void selectRows(string key, string columnName)
{
int count = 0;
foreach(DataRow dr in ((DataView)dg_aspects.DataSource).Table.Rows)
{
if(dr[columnName].ToString()==key)
dg_aspects.Select(count);
else
dg_aspects.UnSelect(count);
count++;
}
}
This works, but when the user clicks a column header to sort the datagrid, the selected columns remain at the same index.
For example - if the top two rows are selected initially.
After sort - the top two rows are still selected, but the datagrid is showing different results in those rows.
It appears that the DataTable the DataGrid is showing, and the DataDource we work with aren't the same where sorting is concerned.
Does anyone know how to get a handle on the sorted DataTable?
I hope that's clear - thanks for taking a look
Steven
|
|
|
|
|
|
I would like to add a tabcontrol to a toolbar. There isn't any Articles that explain how this might be done that I can find, is this going to be possible?
The reason being I want to use HTML Help, I need a content, index and search facility as with:-
HtmlHelp library and example viewer By Klaus Weisser
But I need the whole screen width to be viewable as my HTML pages will either be a full 800x600 or 1024x768. I realise if I use a dockable toolbar then it can be placed 'always on top' over any part of the document (HTML page).
Any help or instruction would be appreciated.
Jason
|
|
|
|
|
Thats Ok I have answered my own questions now.
|
|
|
|
|
In my application, i have to perform wildcard search as provided by Visual Studio .NET Find\Replace module. Visual Studio provides 5 wildcard operators (*,#,?, [! ], []). I have to replace the wildcard with regular expressions. I am facing problem in 2 things.
1.to make a pattern for * operator which with input string say "Test string is to Test for testing purposes by tester" generates output like
- Test string is to Test for testing purposes by tester
- Test for testing purposes by tester
- testing purposes by tester
- tester
2. these operators can be used in combination, so what do u think my basic regular expression will work in combinations?
Anybody worked for wild card search? or know about some stuff to use for such conversion?
Aisha Ikram
|
|
|
|
|
I need a custom print dialog in an application and there is only one small problem left. How do I call the Printer Properties dialog (the one that shows the driver-specific properties of the printer)? There seems to be no built in support for this in .NET so I assume I have to call some DLL (drivers?) to reach this.
Best Regards
pahlsson
|
|
|
|
|
Hello,
Can anyone guide me on how to make my own datatype, that will work same as string but with some difference in the way string implements CompareTo method. It is not possible to extend String class (it is sealed). or is there any chance that I can change string's CompareTo implementation.
I need to use this datatype in DataView and TableStyles.
Thanks in advance.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
Why not just make a static function "MyCompareTo" that u can call instead of string's CompareTo ?
|
|
|
|
|
hi all,
I want to add Windows Form Dialog to Tab Control.we can add controls like text box,labels to TabControl Page.But it is difficult to add Windows Form Dialog to TabControl.
if any one know to do it,please reply me.
Thanks in advance...
|
|
|
|
|
|
That's not entirely true. The Form class derives from Control so it is possible to add a Form to a Controls collection. All you need to do is set the "child" forms' .TopLevel property to False . I know what your thinking, .TopLevel doesn't show up in Intellisense! But, it does show up in the Object browser as a hidden Public property.
I found this little tidbit on MSDN about a year ago, here: Five Tricks for Your Visual Basic .NET Bag[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
A dialog is a top-level window, meaning it can't be parented to a container control like a TabPage . If you want to reuse a UI that you currently have in a dialog, then implement it in a UserControl that you can use both on your dialog (Form ) and your TabControl .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
|
Many Thanks for reply.Now I did it using UserControl.
|
|
|
|
|
Hi !
iam doing a remoting application is c#. the server is a singlecall object run using remoting.configure
xml config file. there is only one client but a group of servers hosting these singlecall objects
. i make invocations by using remoteobject.getactivator method at a very high frequency to get bit map data. when the server machine is running windows 2000 professional the performance is decent but for windows xp pro the performance is very bad. the system is very slow at getting method results. any idea what could be happening. i checked
three windows xp pro machines and as many windows 2000 pro machines. the performance is consistently bad and good respectively.
any help would be great.
thanks.
|
|
|
|
|
SO is the server an XP machine? If so, then it will be slow, as XP's has a lower concurrent connection limit, and you might be creating new connections on every remoting call (error in your code), and hence the lack of speed, have a look in the eventlog (have you even?). without more details, no one could help you.
xacc-ide 0.0.12 now with C#, MSIL, C, XML, ASP.NET and HLSL coloring - Screenshots
|
|
|
|
|
hi leepie thanks for the response man. the server is xp that right. actually since iam using single call remote server objects the objects will get created and destroyed for every call i make. but the channel remains open and there is only one channel running on port 9000. i checked netstat -a for connections and i find only one open all the time on port 9000. as far as the event log is concerned i have yet to see that and post more info on this thread. need guidance.
thanks
|
|
|
|
|