Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do i open a program from a button Pin
C# Beginner Nick26-Nov-07 14:33
C# Beginner Nick26-Nov-07 14:33 
AnswerRe: How do i open a program from a button Pin
Ravi Bhavnani26-Nov-07 14:37
professionalRavi Bhavnani26-Nov-07 14:37 
GeneralRe: How do i open a program from a button Pin
C# Beginner Nick26-Nov-07 14:48
C# Beginner Nick26-Nov-07 14:48 
GeneralRe: How do i open a program from a button Pin
macerenn26-Nov-07 14:37
macerenn26-Nov-07 14:37 
GeneralRe: How do i open a program from a button Pin
Ravi Bhavnani26-Nov-07 14:40
professionalRavi Bhavnani26-Nov-07 14:40 
GeneralRe: How do i open a program from a button Pin
Rich Insley27-Nov-07 5:36
Rich Insley27-Nov-07 5:36 
GeneralRe: How do i open a program from a button Pin
Ravi Bhavnani27-Nov-07 5:58
professionalRavi Bhavnani27-Nov-07 5:58 
QuestionHow can I get the URL address for a TCP Packet? Pin
Khoramdin26-Nov-07 13:46
Khoramdin26-Nov-07 13:46 
Hello everyone,

I am working on a HTTP Sniffer. So far I am able to get some information on a TCP received packet using the following code.

//Create MemoryStream out of the received bytes
                MemoryStream ImemoryStream = new MemoryStream(byteBuffer, 0, nReceived);
                //Next we create a BinaryReader out of the MemoryStream
                BinaryReader IbinaryReader = new BinaryReader(ImemoryStream);

                //The first eight bits of the IP header contain the version and
                //header length so we read them
                byteVersionAndHeaderLength = IbinaryReader.ReadByte();

                //The next eight bits contain the Differentiated services
                byteDifferentiatedServices = IbinaryReader.ReadByte();

                //Next eight bits hold the total length of the datagram
                ushortTotalLength = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());

                //Next sixteen have the identification bytes
                ushortIdentification = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());

                //Next sixteen bits contain the flags and fragmentation offset
                ushortFlagsAndOffset = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());

                //Next eight bits have the TTL value
                byteTTL = IbinaryReader.ReadByte();

                //Next eight represnts the protocol encapsulated in the datagram
                byteProtocol = IbinaryReader.ReadByte();

                //Next sixteen bits contain the checksum of the header
                ushortChecksum = IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());

                //Next thirty two bits have the source IP address
                uintSourceIPAddress = (uint)(IbinaryReader.ReadInt32());

                //Next thirty two hold the destination IP address
                uintDestinationIPAddress = (uint)(IbinaryReader.ReadInt32());


I also need to get the URL address of where the packet are comming from. I have seen some comercial HTTP Sniffer being able to do that. The Sniffer80 available in http://www.codeproject.com/tools/sniffer80.asp[^] also can capture the URL address of the packet. Can someone tell me how I can get this done? Maybe I am looking for a URL address at the wrong place! Where can I get this information for a TCP packet then?

Any information on this would be great. As always, thank you for your help and have a great day.

Khoramdin
AnswerRe: How can I get the URL address for a TCP Packet? Pin
macerenn26-Nov-07 15:19
macerenn26-Nov-07 15:19 
GeneralRe: typedef enum c header to C# Pin
schoetbi26-Nov-07 11:04
schoetbi26-Nov-07 11:04 
GeneralRe: typedef enum c header to C# Pin
Luc Pattyn26-Nov-07 11:29
sitebuilderLuc Pattyn26-Nov-07 11:29 
QuestionPossible to get the location of the launching Shortcut? Pin
Sautin.net26-Nov-07 10:56
Sautin.net26-Nov-07 10:56 
AnswerRe: Possible to get the location of the launching Shortcut? Pin
Anthony Mushrow26-Nov-07 11:02
professionalAnthony Mushrow26-Nov-07 11:02 
QuestionProblem with setting Wallpaper Pin
Y@rpen26-Nov-07 10:43
Y@rpen26-Nov-07 10:43 
QuestionAuthentication and Authorization Pin
kingletas26-Nov-07 10:41
kingletas26-Nov-07 10:41 
AnswerRe: Authentication and Authorization Pin
Skippums26-Nov-07 11:11
Skippums26-Nov-07 11:11 
Questiontypedef enum c header to C# Pin
schoetbi26-Nov-07 10:11
schoetbi26-Nov-07 10:11 
AnswerRe: typedef enum c header to C# Pin
Luc Pattyn26-Nov-07 10:57
sitebuilderLuc Pattyn26-Nov-07 10:57 
GeneralRe: typedef enum c header to C# Pin
schoetbi26-Nov-07 10:59
schoetbi26-Nov-07 10:59 
GeneralRe: typedef enum c header to C# Pin
Pete O'Hanlon26-Nov-07 11:01
mvePete O'Hanlon26-Nov-07 11:01 
AnswerRe: typedef enum c header to C# Pin
PIEBALDconsult26-Nov-07 11:27
mvePIEBALDconsult26-Nov-07 11:27 
AnswerRe: typedef enum c header to C# Pin
m026-Nov-07 13:05
m026-Nov-07 13:05 
Questionasp.net subdomain Pin
Eli Nurman26-Nov-07 10:07
Eli Nurman26-Nov-07 10:07 
AnswerRe: asp.net subdomain Pin
Paul Conrad26-Nov-07 16:01
professionalPaul Conrad26-Nov-07 16:01 
Questioncopy and paste Pin
netJP12L26-Nov-07 9:46
netJP12L26-Nov-07 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.