|
hi I have made an small application in C# from the book Network Programming with C# and VB.Net for capturing packets. Now my question is that author has shown application for a single machine but what if I want to do the same for a LAN where in from the server side i can get the traffic of clients is it possible in .Net using Raw Socket Capturing or Will I have to use WinPcap ? I would be happy to see your reply thanks.
|
|
|
|
|
vighu wrote: what if I want to do the same for a LAN where in from the server side i can get the traffic of clients
In todays switched networks, this isn't really possible any more. The switch has to do the packet sniffing and forwards the captured packets to a listen specifically setup to do so.
If your case, if your sniffer is running on the server, you can only see the packets comming to or leaving the server. You can't see, without some help from the switch, any other traffic.
WinPcap supplies a ready made library to do raw packet capturing...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Where can I find the above class in the .NET framework v2? It used to be at: System.Security.Cryptography.Xml.XmlDsigC14NTransform but not on my PC or my PC at work both running VS2005?
|
|
|
|
|
Are you sure your current project references the system.security.dll that contains this class?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Ah, thats it. Now I feel foolish. I hope this helps the OP too.
BTW, how would one know to add that reference from the documentation?
|
|
|
|
|
That's what is written at the top of the MSDN site for this class:
Represents the C14N XML canonicalization transform for a digital signature as defined by the World Wide Web Consortium (W3C), without comments.
Namespace: System.Security.Cryptography.Xml
Assembly: System.Security (in system.security.dll)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Is that different from the built in Studio 2005 online documentation?
I was using the online help (F1) and cannot find that dll referenced in either the System.Security.Cryptography.Xml namespace or the XmlDsigC14NTransform class.
|
|
|
|
|
That's a quote from the built in VS 2005 help when searching for "XmlDsigC14NTransform" and clicking on the item "about XmlDsigC14NTransform class"
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Oooooooooooooh now I see.
tyvm
|
|
|
|
|
All documentation I find points to that same location, but yet I cannot use the class either. It seems my system cannot find the XML namespace within Cryptography.
Perhaps there is something not registered or installed correctly
I'm still looking.
|
|
|
|
|
Hi,
How can I add a new row to the bottem of gridview?
Thanks much,
Hung.
Hung
|
|
|
|
|
The gridview has a Rows property which represents the collection of rows in the grid.
Have you tried manipulating this collection directly? For instance:
GridView.Rows.Add(new Object[] {1, "Value"})
I also think you could create a new GridViewRow object separately and then later add it to the GridView.Rows collection.
I must confess, I'm a bit of a novice myself and just here trying to answer questions to force myself to learn more Good luck!
|
|
|
|
|
What the language between C#.NET and VisualC++/MFC suit to develope on .NET framework?
|
|
|
|
|
I do not know personally, but I have never heard good things about doing managed C++ (C++ in the .NET framework).
I would suggest C# (which is not very C like imo) or VB.NET as they were designed specifically for the .NET runtime. Also, VB.NET will make the syntax easier if you ever have to go back and support some VB6 code.
I don't think you get the control from C++ you may be used to when developing a .NET application, so I have never used it for that purpose.
|
|
|
|
|
C, C++, Java, C# are one big evolving family.
I recommend C# for almost everything.
The other .NET languages are there mainly to attract VB or C++ addicts.
|
|
|
|
|
Hi everyone,
i'm using resource files to change controls language on the form whe button is pressed.Now my problem is to how to change tooltip language with the same method.
|
|
|
|
|
Hi.
I have some problems parsing C# source code with regular expressions and counting the available methods.
this is what i use as test data:
public int GetNumber(int number)
{
return number;
}
private string GetCountry()
{
return "England";
}
public Constructor()
{
}
private Constructor(string test)
{
}
But every try I make at parsing this, both the methods and constructors gets matched as methods. The problem is that the visibility (public, private) of the method does not have to be there. example: void HelloWorld()
Can anyone shed some light on this?
|
|
|
|
|
If you only need to count the methods you could match both and then find which is the constructor and remove it. If you need more info than that regular expressions might limit you. If you compile it you could use reflection or you could use a complete parser like NRefactory (part of SharpDevelop).
|
|
|
|
|
GentooBoxX wrote: But every try I make at parsing this, both the methods and constructors gets matched as methods. The problem is that the visibility (public, private) of the method does not have to be there. example: void HelloWorld()
I've not had much experience with regex, unfortunately, so I can't suggest a regex expression that will work. However, as far as getting false positives with constructures, one way to eliminate them when you find a method is check the method's name. If the name matches that of the class, you can tag it as a constructor.
As far as finding methods in the first place, hmm... Wouldn't every line that ends with a right closing parenthesis ')' and is not followed by a semicolone indicate that the line is the beginning of a method? Just thinking out loud.
EDIT-> Using the method described in the above paragraph... watch out for comments. For example:
Also, watch out for catch, using, and lock statements.
-- modified at 15:48 Saturday 24th February, 2007
|
|
|
|
|
If i can do this with regex only, thats what i'm going to do. I started this project to get better in regular expressions.
Thanks for the suggestion on finding methods, never thought of it that way. But there is one problem with this method, it can be used to find methods, but not extract the name, type and visibility (public, private).
I'm currently trying to find every "method" with the same name as the class by using regular expressions, but i must be missing something fundamental, because its not working they way i want it.
It possible to reuse capturing groups in regular expressions, but its not working.. yet.
this is for finding the class:
public class (?<classname>\w+)\n*\s*\{
very simple right now, this is the regex extended to reuse the class name:
public class (\w+)\n*\s*\{\n*\s*public \w+ \1
But its not working, if anyone have some info on this, please contribute.
|
|
|
|
|
How To Create transparent Form
s
|
|
|
|
|
either you set the opacity to 0 or make the form's back color the same as it's transparency key
|
|
|
|
|
I think you can't have a Datagrid with out a table.
But what I want to do is get a list of Jgp files on my computer and display them in a list, with a tick box, a preview of the JPG and a text box with the path.
What would be the best way to present this as a list on screen?
Sorry if this seems an easy question.
Tony
|
|
|
|
|
You can create a DataGridView without a datasource by manually adding columns and rows. However, using some type of datasource is going to be your best bet.
Create a class to represent your image specifics and then create a typed collection for your class. Set the datasource of the data grid to your collection. I use a 3rd party grid so you may have some slightly different steps, but this is the meat of it. (For example, you may have to dump the collection into a BindingSource -- I'm not sure though.)
|
|
|
|
|
How do I go about putting an image (in my case, I want an arrow denoting direction of sort) in the header of a ListView TO THE RIGHT of the text? Is it possible without resorting to using APIs? If not, is it pretty much like doing it in VC++ (which I have seen code on here at CodeProject)? Can you direct me to an example?
Secondary question... How do I change the background color of a column in a ListView? Again, can it be done without APIs? Is it done like in VC++? Where can I find an example?
Thanks.
|
|
|
|