|
I've done this once before by writing an NDIS Driver. That was many years ago and it certainly isn't possible in C#
The basic idea of an NDIS Driver is that it sits and monitors raw packets as they go to and from your network card and allows you an opportunity to drop, modify or permit the packet through. It operates at a very low level and you MUST understand how individual packets are stitched together at the network level (lower level than TCP or IP) because that is all you will see. You will not see a nice stream of data for one connection, you will see everything regardless of how fragmented it is.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hi
I have exactly the same problem. Have you find any answer
|
|
|
|
|
Write an NDIS driver to intercept the data at the packet level. You cannot do that in C# tho'
|
|
|
|
|
Hello , i have some problems when i am in fullscreen. First text was good in quality but it had problems in characters' edges , so i looked for GDI+ info and found this :
g.TextRenderingHint= System.Drawing.Text.TextRenderingHint.AntiAlias ;
Antialising made it better in edges , but it looked worse this time , it looked fogged ( i am not sure that it is the correct word)
How can i fix it ?
The code is below :
public StringFormat GetStringFormat()
{
int numChars = m_String.Length;
CharacterRange[] characterRanges = new CharacterRange[numChars];
Region[] stringRegions = new Region[numChars];
for (int i = 0; i < numChars; i++)
characterRanges[i] = new CharacterRange(i, 1);
StringFormat stringFormat = new StringFormat();
stringFormat.FormatFlags = StringFormatFlags.NoClip;
stringFormat.SetMeasurableCharacterRanges(characterRanges);
return stringFormat;
}
public void DrawText(double SampleTime, IntPtr pBuffer, int BufferLen)
{
Rectangle rec = this.ClientRectangle;
g = Graphics.FromImage(bitmapOverlay);
g.Clear(Color.Transparent);
g.SmoothingMode = SmoothingMode.HighQuality ;
g.TextRenderingHint= System.Drawing.Text.TextRenderingHint.AntiAlias ;
d = g.MeasureString(m_String, fontOverlay);
if (boolshadow == true)
{
SolidBrush myBrush = new SolidBrush (Color.Black );
g.DrawString(m_String, fontOverlay, myBrush, stringXPos + strshadow, stringYPos + strshadow);// System.Drawing.StringFormat.GenericTypographic
}
g.DrawString(m_String, fontOverlay, brush, stringXPos, stringYPos, System.Drawing.StringFormat.GenericDefault);
if (logo != null)
{
int xpos = (int)logoXPos;
int ypos = (int)logoYPos;
Rectangle dstRect = new Rectangle(xpos, ypos, logo.Width, logo.Height);
Rectangle r = Screen.PrimaryScreen.WorkingArea;
//MessageBox.Show(r.Width.ToString());
//MessageBox.Show(r.Height.ToString());
g.DrawImage(logo, dstRect,0,0, logo.Width, logo.Height, GraphicsUnit.Pixel, attr);
}
bitmapOverlay.RotateFlip(RotateFlipType.RotateNoneFlipY);
Bitmap v = new Bitmap(lWidth, lHeight, videoStride, System.Drawing.Imaging.PixelFormat.Format32bppPArgb, pBuffer);
g = Graphics.FromImage(v);
g.DrawImage(bitmapOverlay, 0, 0, lWidth, lHeight);
g.Dispose();
v.Dispose();
}
|
|
|
|
|
hi all
Can any one tell me how to open a text file in a text box and print the file contant
merwa
|
|
|
|
|
|
Haven't had much luck searching for this in the forums or online. I've done some programming in VB.NET and want to make the jump to C#. A lot of the beginning C# books are a little too introductory. I'm wondering if anyone has a recommendation for a book that is more focused on learning the language, syntax, and features of the language rather than a ground up intro to the .Net framework, OOP, etc... Any insight/recommendations would be greatly appreciated.
|
|
|
|
|
Illustrated C# 2005 or any Apress books are good.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Thank you, this looks like just the type of book I was looking for. Ended up picking up this as well as Windows Forms Programming in C#. Thank you all for the help.
|
|
|
|
|
If in doubt use {}, end everything with ; and never ever captilize the first letter, ever
Seriously though, if you're comfortable and familiar with the framework and concepts of OO it won't be that hard.
I have an idea to help though. The following is a pretty good code converter, try writing VB stuff and see how it looks in C#:
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx[^]
Doesn't do generics though.
------------------------------------------------
I'm largely language agnostic -
After a while they all bug me
------------------------------------------------
|
|
|
|
|
MidwestLimey wrote: never ever captilize the first letter
you may need an Application, a Form, a Console, and many more Controls...
|
|
|
|
|
addendum:
Use capitals only when forced to by the bloody framework and never make clear in 5 lines that which can be in-lined in one
Welcome to the C# club.
------------------------------------------------
I'm largely language agnostic -
After a while they all bug me
------------------------------------------------
|
|
|
|
|
Starting out with C++ by Tony Gaddis ISBN 9780321409393
This is what we used in college and has nothing about .NET and such (at least the older version anyhow. We used the 3rd edition but I know there has been at least one more edition since then.)
This is a great book for anyone who has little to no programming experience.
______________________
stuff + cats = awesome
|
|
|
|
|
|
Programming C#, 3rd Edition by Jesse Liberty (ISBN: 0-596-00489-3)
Windows Forms Programming in C# by Chris Sells (ISBN: 0-321-11620-8)
Pragmatic ADO.NET: Data Access for the Internet World by Shawn Wildermuth (ISBN: 0-201-74568-2)
Hope this books will be very much Helpful for you.
Regards,
Satips.
|
|
|
|
|
What I can say is "Dont even bother with C# Bible[^]"
It is a good example of what you don't want. It has a lot to say on OOP and the .NET Framework but very little on Socket Comms and doesn't even mention Marshalling.
I've found CodeProject to be of more help than this book.
|
|
|
|
|
Hello,
I have the following to do:
1) Windows Service which should provide some data to other applications...
2) application which handles this messages.
It is not so important that all messages comes to the applications...For that I thought about the possibility to use an udp socket.
What do you think about that? Is there a better possibility to send this messages in dotnet?
Best regards
Hansjörg
|
|
|
|
|
Hi!
Your service could publish a remoting server. That way it's really easy for the application to communicate with the service.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
have you some good links about that topic?
Best regards
Hansjörg
|
|
|
|
|
Sure!
Here you go[^]
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello,
If anyone can help me with this it would be great. Maybe someone can even write a tutorial.
I am trying to create a simple user control. It doesn't really matter what kind of control it is, the key thing is, this control cannot be resized through code or designer. For example, the height of the textbox control cannot be changed. I am trying to get similar results, except that width cannot be changed as well.
Sincerely,
Michael Korin
|
|
|
|
|
Try writing a (private?) bool property named Resizable. Then you can ask at some point (OnResizing event or something alike) if it can be resized, if not return the size to its initial value.
|
|
|
|
|
Thanks for the reply, but this is not what I am looking for.
You are telling me a workaround. You can do it even better by overwriting the size method
[Browsable(false),
EditorBrowsable(EditorBrowsableState.Never)]
public new Size Size
{
get {return new Size(20,20);}
set {}
}
But when you place this element in the designer, it still shows 9 squares around it appearing to be resizable (Even though when you try to resize, it will move it instead keeping the size). I want my control to look somehow like textbox where you can't resize it in the editor. Further I want to remove the SizeChanged and Resize even handlers so that they are not accessible through designer or code.
Thank you for your suggestion though.
Mike
|
|
|
|
|
Hello,
Maybe the "Locked" property helps you a little more.
All the best,
Martin
|
|
|
|
|
i have a database object which retrieves all the data.
and i have the xml file(excel format) in textwriter mode. how can i attach dtaset to xml file and i want to transform that using xsl file
can any body know this pls help me
thanks
satya
|
|
|
|