|
I have some image and some point collection that represent some part of the image.
I need to look for all the rectangle that appear in the image according to the point collection.
What is the best way to do it ?
|
|
|
|
|
A rectangle can be made from any two points where X != X && Y != Y so you need to determine how you want to identify a rectangle.
|
|
|
|
|
Hi all,
I want to use process.start function with "sc delete servicename" command
How can I do this??
|
|
|
|
|
I find it,I have dealed with it since morning,
string argu = "/C sc delete SistemName";
System.Diagnostics.Process.Start("cmd", argu);
good works..
|
|
|
|
|
One way to do it is to specify the delete servicename as the Arguments in a ProcessStartInfo instance.
|
|
|
|
|
Im trying to make it so I can see the red through the other picture box like a opacity, this is what I mean, click on this link http://img194.imageshack.us/f/capturemzd.jpg/[^] I want it to be like transparent but not see the background, I want it so I can see the other red picture box
|
|
|
|
|
So you want to show what's underneath without using opacity?
The only way I can think of to achieve this is to create a copy of the the underlying image, overlay that image copy over the topmost image, and clip it where the two rectangles don't overlay each other.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I heared there was like these squares and circles in VB or something that you can just put on, but i can't find this feature in C# would you know where to get them?
|
|
|
|
|
Google for "VB.NET Power Pack" for those controls. But, from you're description, they won't solve your problem. You're going to have to draw these images yourself as has already been suggested.
|
|
|
|
|
What have you tried so far?
|
|
|
|
|
Dear Folks,
I need to read all the content present in the PDF File into a Console Application or reading it to a text file. Please can any one help me the any samples and API's for PDF also.
Please i have a dead line it to Finsih.. Please help me..
|
|
|
|
|
Try ABC.PDF or iTexdSharp. I'm sure you can figure out how to find them...
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I have added an app.config file in my winform aplicaion an added one key
<pre><add key="IsFirstRun" value="True" /></pre>
then I am tying to read it like this:
<pre>MessageBox.Show(ConfigurationManager.AppSettings["IsFirstRun"].ToString());</pre>
but I am getting this error:
<pre>Configuration system failed to initialize</pre>
on the MessageBox line..
why? how ca I fix please?
|
|
|
|
|
jrahma wrote: <pre><add key="IsFirstRun" value="True" /></pre>
Rather than
<add key="IsFirstRun" value="True" />
I would try
<add key="IsFirstRun" value="True"></add>
|
|
|
|
|
Have you added an appSettings section?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="IsFirstRun" value="True" />
</appSettings>
</configuration>
|
|
|
|
|
In order to get pci devices on computer , I need to read/write 32 bit command to address 0xcf8 and 0xcfc.
I found the WINIO.dll can do this thing.
I wrote a following code to test function.
It can built without any error.
But the value return from 0xcfc never changed.
I can not find the explanation of the winio.
Please help me find out what's wrong with my code.
Thanks
[DllImport("winio.dll")]
public static extern bool InitializeWinIo();
[DllImport("winio.dll")]
public static extern bool GetPortVal(uint wPortAddr, ref uint pdwPortVal, byte bSize);
[DllImport("winio.dll")]
public static extern bool SetPortVal(uint wPortAddr, uint dwPortVal, byte bSize);
[DllImport("winio.dll")]
public static extern void ShutdownWinIo();
uint Bus_No,Dev,Func,VID,DID,count=0;
uint Rt_Val=0x00;
for (Bus_No = 0; Bus_No < 15; Bus_No++)
{
for (Dev = 0; Dev < 32; Dev++)
{
for (Func = 0; Func < 8; Func++)
{
uint Val = 0x80000000 + (Bus_No << 16) + (Dev << 11) + (Func << 8);
SetPortVal(0xcf8, Val, 4);
GetPortVal(0xcfC,ref Rt_Val, 4);
if (Rt_Val != 0xffffffff)
{
count++;
VID = Rt_Val & 0xffff;
DID = (Rt_Val >> 16) & 0xffff;
MessageBox.Show("VID" + VID);
pcitest.Text = Convert.ToString(VID);
if (Func == 0)
{
Val = (Val & 0xfffffff0) + 0x0c;
SetPortVal(0xcf8, Val, 4);
GetPortVal(0xcfc, ref Rt_Val, 4);
Rt_Val = Rt_Val >> 16;
if ((Rt_Val & 0x80) == 0) Func = 8;
}
}
}
}
|
|
|
|
|
WinIo is not part of Windows but a third party library. You're going to have to ask the people who wrote that library how to use it and they may even be able to provide you with the documentation on that library.
|
|
|
|
|
Hi,
I'm trying to use raw sockets, but I have some problems with the 3-way handshake.
The problem is that the server doesn't answer me when I send the SYN packet.
Maybe, it's a class problem. This is the class for the TCP header:
public enum TcpHeaderFlags : byte
{
CWR = 128,
ECE = 64,
URG = 32,
ACK = 16,
PSH = 8,
RST = 4,
SYN = 2,
FIN = 1,
None = 0
}
public class TcpHeader : ProtocolHeader
{
public UInt16 SourcePort = 80;
public UInt16 DestinationPort = 80;
public UInt32 SequenceNumber = 0;
public UInt32 AcknowledgmentNumber = 0;
private byte DataOffsetAndReserved = 0;
public TcpHeaderFlags Flags = TcpHeaderFlags.None;
public UInt16 WindowSize = UInt16.MaxValue;
public UInt16 Checksum = 0;
public UInt16 UrgentPointer = 0;
public override byte[] GetProtocolPacketBytes(byte[] payLoad)
{
MemoryStream memStream = new MemoryStream();
byte[] buffer = null;
buffer = BitConverter.GetBytes(SourcePort);
memStream.Write(buffer, 0, buffer.Length);
buffer = BitConverter.GetBytes(DestinationPort);
memStream.Write(buffer, 0, buffer.Length);
buffer = BitConverter.GetBytes(SequenceNumber);
memStream.Write(buffer, 0, buffer.Length);
buffer = BitConverter.GetBytes(AcknowledgmentNumber);
memStream.Write(buffer, 0, buffer.Length);
memStream.Write(new byte[] { DataOffsetAndReserved }, 0, 1);
memStream.Write(new byte[] { (byte)Flags }, 0, 1);
buffer = BitConverter.GetBytes(WindowSize);
memStream.Write(buffer, 0, buffer.Length);
buffer = BitConverter.GetBytes(Checksum);
memStream.Write(buffer, 0, buffer.Length);
buffer = BitConverter.GetBytes(UrgentPointer);
memStream.Write(buffer, 0, buffer.Length);
return memStream.ToArray().Concat(payLoad).ToArray();
}
}
So, my question is:
please, can you give me a working class for the tcp header??
PS:
I've taken the IP header class from this site:
http://www.winsocketdotnetworkprogramming.com/clientserversocketnetworkcommunication8chap.html[^]
|
|
|
|
|
You may first want to read a small section in this article[^] on Raw Sockets.
Reads:
Limitations on Raw Sockets
On Windows 7, Windows Server 2008 R2, Windows Vista, and Windows XP with Service Pack 2 (SP2), the ability to send traffic over raw sockets has been restricted in several ways:
•TCP data cannot be sent over raw sockets.
•UDP datagrams with an invalid source address cannot be sent over raw sockets. The IP source address for any outgoing UDP datagram must exist on a network interface or the datagram is dropped. This change was made to limit the ability of malicious code to create distributed denial-of-service attacks and limits the ability to send spoofed packets (TCP/IP packets with a forged source IP address).
•A call to the bind function with a raw socket is not allowed.
These above restrictions do not apply to Windows Server 2008 , Windows Server 2003, or to versions of the operating system earlier than Windows XP with SP2.
Note The Microsoft implementation of TCP/IP on Windows is capable of opening a raw UDP or TCP socket based on the above restrictions. But other Winsock providers may not support the use of raw sockets.
There are further limitations for applications that use a socket of type SOCK_RAW. For example, all applications listening for a specific protocol will receive all packets received for this protocol. This may not be what is desired for multiple applications using a protocol. This is also not suitable for high-performance applications. To get around these issues, it may be required to write a Windows network protocol driver (device driver) for the specific network protocol. This requires a Transport Driver Interface (TDI) provider and a Winsock helper DLL be written to support the network protocol. The network protocol would then be added to the Winsock catalog as a supported protocol. This allows multiple applications to open sockets for this specific protocol and the device driver can keep track of which socket receives specific packets and errors. For information on writing a network protocol provider, see the sections on TDI in the Microsoft Windows Driver Kit (WDK).
Applications also need to be aware of the impact that firewall settings may have on sending and receiving packets using raw sockets.
|
|
|
|
|
So... I cannot use the RawSockets...
I decided to use the RawSockets because I needed to change the source IP of the packet, because I'm writing a crawler.
The problem is that after some requests, I get 403 errors, so I thought it was because the server has a sort of protection against DDoS attacks, and I decided to change my source IP.
If you have any other solutions for the problem of the 403 errors,
please, save my life!
|
|
|
|
|
First, changing the source IP is what everyone looks for in a spoofed packet, so that's out. Besides, if you don't have a server listening at that IP address, the return data just went to never-never land.
Second, you didn't read the line I posted that started with "The above restrictions do not apply to...", did you?
|
|
|
|
|
How does .NET handles a winapi that doesn't exsist on current OS, for example: If it was proggramed on Windows 7 64bit and then attempted to use on Windows XP 32 bit?
API IsWow64Process does exsist in 64 bit OS, but does it exsist in 32bit version?
edit: Re-edited question
|
|
|
|
|
P/Invoke problems are signaled through exceptions, see here[^] for some details.
So you may choose to use some try-catch construct.
|
|
|
|
|
Thank you, as other question does IsWow64Process exsist in 32 bit Windows?
|
|
|
|
|
I don't know.
Read the documentation.
Google.
Try it.
|
|
|
|
|