I have a datadridview control in Windows form (C#). In that DataGridView, I have a Date Column (DateTime Class). Now, when An user enters an invalid entry like (abcd/aa.etc) then An Exception is thrown with a messagebox. At the bottom of that message box, it is said that, if you want to replace this message, handle DataError Event. Now Where can I put the code ( try catch ) block to handle this dataError Event.
I paint on Graphics object and i need to "pain" or change color of one, small pixel - and i have no idea how to do it. Drawing one-pixel-long lines don't work (lines don't show) - others Rectangles or Polygons don't work (they are too big or not visible) - any ideas? :/
Ideal compilator compiling comments without code...
Your DataGridViewRow has no idea where to put "oo". You need to set the row schema from the DataGridView to which you intend to add the row. If you've defined your single column in your DataGridView definition, then it's cake:
DataGridViewRow rw = new DataGridViewRow();
I am developing a Network Authentication Server, and I am using RAW Sockets to transmit packets to the internet.The receiving side works fine, but I get a "A blocking operation was interrupted by a call to WSACancelBlockingCall" ONLY when I try to send packets using TCP. Apparently this is due to the Windows update MS05-019 which disables the use of Raw Sockets.
I have tried the xpsp2tcpipfix.exe which modified the tcpip.sys...invain.
Then I tried to disable the SharedAccess service...still invain.
Apparently both of the above work fine for SP2 but not for MS05-019.
My alternate solutions would be either to
- reinstall windows without service packs (i need to confirm this will not be a waste of time)
- install an ethernet adsl modem (currently usb),-requires time & money :S
- find a way to uninstall MS05-019
I would apreciate any other solution, help, advice/clues on my options or any knowledge from anyone that has encountered this problem before or anybody that has ANY idea.
RAW means that i am generating the whole IP packet from scratch, including both the IP header, and the TCP header.
This is done using
socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
socket.Connect(new IPEndPoint(IPAddress.None, 0));
and sending the whole packet stored in a buffer 'byte tmp', which contains source ip, destip, checksum...etc...in other words all the headers.
As I mentioned before, the whole thing works fine for any packet, coz I checked them out with Ethereal. However when I change the protocol field in the IP header to 6, standing for TCP, I get the afore mentioned error, probably due to the XP update disabling raw packets.
Strictly speaking yes, I can simplyfy things and open a TCP client using .Net, howvever I was planning to implement my project with another final year project at a later stage, concerning TCP congestion control algorithims. This requires read and write access to the whole TCP layer, including the header.
So IDEALLY I stick to raw, but if nothing pops up I will have to do without.
Ok things are beginning to get clearer in my head now. Is WSACancelBlockingCall called by you or (as it appears) is fired from another program, i.e. this MS-9015 (wrong number I thing) thingy.
My first suggestion would be to if possible isolate the area of the network you're concerned with (i.e. don't connect it to the internet just have ideally two computers (or one with using the loopback interface) on the network. Then try the code while turning off all the network systems, i.e. firewalls, antivirus etc until you get to the one which is hopefully causing the problem. Once this has been established then we can delve further for a work-around.
Im not sending any WSACancelBlockingCall, so I assume this is due the update, at least this site lead me to think so: "http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2netwk.mspx#".
Good idea though, I will experiment Raw Sockets on my lan. Luckily I already got over the lan side by using an NDIS driver..and succesfully sent and received TCP over IP over Ethernet, and all other protocols. As regards firewalls and antivirus, I never had any of those.
So when you say you change the header to 6 representing TCP do you mean you do that to every packet or only TCP packets? You cannot change a UDP or most other packets to TCP. Make sure that isn't the case.
Im refering to the protocol field in the IP header. These are represented as
- 0: Reserved
- 1: Internet Control Message Protocol (ICMP)
- 2: Internet Group Management Protocol (IGMP)
- 3: Gateway-to-Gateway Protocol (GGP)
- 4: IP (IP encapsulation)
- 5: Stream
- 6: Transmission Control Protocol (TCP)
- 8: Exterior Gateway Protocol (EGP)
- 9: Private Interior Routing Protocol
- 17: User Datagram Protocol (UDP)
- 41: IP Version 6 (IPv6)
- 50: Encap Security Payload for IPv6 (ESP)
- 51: Authentication Header for IPv6 (AH)
- 89: Open Shortest Path First
I change it to 6 when the TCP layer contains TCP data, and this is correct as I am forwarding it directly from another user, and shows up correctly on Ethereal. As I mentioned before the problem is probably due to the Windows Update as seen on "http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2netwk.mspx#E5AAE"
If you can get a reference to the Element which represents the image then I think you might be able to get it by using a method named something like GetAttributeValue (sorry I can't remember it exactly of the top of my head), if you call this with "width" and "height" as parameters I think you can get the height and width of the image (not the original image size but the size of the displayed image on the page).
You are correct: use the HtmlElement class and GetAttribute() method to get the image size with width & height as parameters. However I was referring to the "file" size (in bytes) of the image file. I know IE stores the webpage files in "Temporary Internet Files" folder as local cache but somehow programmatically it (OS?) does not allow the files to be read. However you can manually see these files using Windows Explorer.
Thanks. You are correct. My dilemma is I'm using WebBrowser control first to navigate to the webpage to get all the images names via HtmlDocument/HtmlElement classes. If I use WebRequest/WebResponse, I'm essentially doing two requests from the server. I'm thinking if there a way to just do these things once. I don't have to use WebBrowser control but it helps in easily parsing the desired attributes.
Appreciate your help. Things are looking up!
BTW: I tried accessing a local image and I got a "401" not authorized error message.
-- modified at 13:51 Tuesday 18th April, 2006
Last Visit: 31-Dec-99 19:00 Last Update: 6-Dec-22 15:09