|
Every object has a default constructor, unless it's explicitly made private, in which case, it's designed to be created by a factory method. You'll need to find the method and call it, I'd have thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Have a look at RSAParameters in .Net Reflector. The entire struct is just made up of public field members.
No constructors, methods, or properties.
There are a number of these objects that are in the .net library, and i'd like to know how to create an instance. From tinkering with COM i gather most objects of this type are used in marshaling.
And while i'm at it, what about int16/32/64 etc? I know I can parse them from a string but is there anyway to create an instance directly of a particular value?
Cata
|
|
|
|
|
Can anyone suggest how I can capture any packet that is sent from a host? The idea is to not let the packet out into the network, but to capture it, generate our own reply and send it back to the host. If I have the packet, I know how to strip it into the various layers and make a new one to send back. The problem is actually getting the initial packet.
I've looked at sniffer source code but that seems only to look what packets are on the line and not physically take them. Someone said that I should use a NIC in promiscuous mode? As far as I know, a NIC in promiscuous mode will listen to any packets on the network, not just ones destined for its own interface. I only want to capture the packets from the host that the application is running on and not from any other machine on the network. To try make this clearer, when the application is running, the host will not be able to communicate over the network but instead will only be able to communicate to the application.
Any help or pointers in any direction will be greatly appreciated!
Thanks!
|
|
|
|
|
Well, one problem you have is that Raw Sockets are restricted to Administrator use only. Normal users can't create packets from scratch...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the response! The application will be used in a classroom where each student will be running a server, so the Admin use is not a problem.
|
|
|
|
|
Hi,
I put a combobox on my winform C# and each time the user touch by mistake the mouse scroll wheel it gives another selection in the list and that's what I would like to avoid.
Is there a property where I can cancel the scroll wheel for the combobox?
Thanks for your help
from a beginner
|
|
|
|
|
No, there isn't.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There's no property to use, but you can subclass a ComboBox and stop the scroll wheel message (WM_MOUSEWHEEL ) from getting through by overriding the WndProc [^] method
public class ComboBoxEx : ComboBox<br />
{<br />
public ComboBoxEx() : base()<br />
{<br />
<br />
}<br />
<br />
<br />
protected override void WndProc(ref Message m)<br />
{<br />
if (m.Msg == 0x020A )<br />
{<br />
return;<br />
}<br />
<br />
base.WndProc (ref m);<br />
}<br />
}
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Hi Mathew,
Thanks for your code. Easy and it works fine.
Regards,
Davy
|
|
|
|
|
No worries
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
How can i hide or remove 1 or 2 of the buttons (next/previous month) in the MonthCalendar Control ?
Is there a way to do it ?
|
|
|
|
|
I don't think it's possible, the MonthCalendar control is a wrapper around the SysMonthCal32 common control and I don't see that as an option in the native control.
James
|
|
|
|
|
Hi all,
I am trying to achieve the same behavior as the FlowLayoutPanel control found in .NET 2.0, but with our current .NET 1.1 project.
Anyone knows of a 3rd party control that can do that?
Thanks!
|
|
|
|
|
|
I am trying to build a lottery program and want to read a comma delimited text file into my program and display it into text boxes has anybody got any suggestions or any help
|
|
|
|
|
|
If you have used Autocad , you must know how convenient it is to use "pan",Zoom in realtime.
I am wondering how can we move an image inside a picture box, after zoom in or our.
Can Anyone help?
jim
|
|
|
|
|
Look at Graphics.Transform, should be all you need ie
float scale = percentagezoom/100f;
g.Transform = new Matrix(scale,0,0,scale, xoffest, yoffset);
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
thank ya leppie, after several hour , I got it worked,
////////////////////
everyone is my teacher
|
|
|
|
|
Hi,
I'm quite new to C# especially when using GDI+. I saw the solution for zooming an image, but I didn't manage to zoom.
I couldn't quite understand what the parameters in "new Matrix(scale,0,0,scale, xoffest, yoffset);" mean I think
In order to zoom my image by 25% I implemented your code in the following way:
float scale = 25f/100f;
pictureBox.Image.Save("OriginalImage.png",ImageFormat.Png);
Graphics g = Graphics.FromImage(pictureBox.Image);
g.Transform = new Matrix(scale,0,0,scale, 0, 0);
pictureBox.Image.Save("ResizedImage.png", ImageFormat.Png);
pictureBox.Image = Image.FromFile("ResizedImage.png"); //to load the new image
What am I doing wrong please?
Thanks A Lot!
C.N.
|
|
|
|
|
SqlConnection mySqlconnection = new SqlConnection("server=localhost;database=Northwind;uid=sa;pwd=sa");
is an example on how to connect to a database in ms sql server
my question is: how do we connect to the database of the server if the ms sql server is using soley on windows authentication to log in, and not using sql login id or password.
|
|
|
|
|
windcar04 wrote:
SqlConnection mySqlconnection = new SqlConnection("server=localhost;database=Northwind;uid=sa;pwd=sa");
SqlConnection mySqlconnection = new SqlConnection("server=localhost;database=Northwind;Integrated Security=True");
|
|
|
|
|
|
|
I was just in Barnes and Noble and I was skimming through the book "Effective C#" by Bill Wagner. One of his tips was that you should never have a public variable in a class, that you should ALWAYS use properties. This sorta goes against some things that I've read in other books. I was just curious what others thought about it. Isnt there extra overhead for using properties?
|
|
|
|