Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: JIT debugger Error. Pin
OriginalGriff19-Jan-10 1:16
mveOriginalGriff19-Jan-10 1:16 
GeneralRe: JIT debugger Error. Pin
Luc Pattyn19-Jan-10 1:14
sitebuilderLuc Pattyn19-Jan-10 1:14 
GeneralRe: JIT debugger Error. Pin
OriginalGriff19-Jan-10 1:19
mveOriginalGriff19-Jan-10 1:19 
GeneralRe: JIT debugger Error. Pin
Sunil G19-Jan-10 1:25
Sunil G19-Jan-10 1:25 
QuestionContextMenuStrip dynamic item widths Pin
DarrenShultz18-Jan-10 18:42
DarrenShultz18-Jan-10 18:42 
AnswerRe: ContextMenuStrip dynamic item widths Pin
April Fans19-Jan-10 17:52
April Fans19-Jan-10 17:52 
GeneralRe: ContextMenuStrip dynamic item widths Pin
DarrenShultz19-Jan-10 19:08
DarrenShultz19-Jan-10 19:08 
Questionexport DataGridView to excel 2007 in c# Pin
H.R18-Jan-10 18:21
H.R18-Jan-10 18:21 
AnswerRe: export DataGridView to excel 2007 in c# Pin
dan!sh 18-Jan-10 19:17
professional dan!sh 18-Jan-10 19:17 
QuestionKeep from erasing working code in a project Pin
tonyonlinux18-Jan-10 18:11
tonyonlinux18-Jan-10 18:11 
AnswerMessage Closed Pin
18-Jan-10 18:46
stancrm18-Jan-10 18:46 
GeneralRe: Keep from erasing working code in a project Pin
tonyonlinux18-Jan-10 20:29
tonyonlinux18-Jan-10 20:29 
GeneralRe: Keep from erasing working code in a project Pin
Bekjong18-Jan-10 22:02
Bekjong18-Jan-10 22:02 
AnswerRe: Keep from erasing working code in a project Pin
Ashfield18-Jan-10 21:09
Ashfield18-Jan-10 21:09 
Questionexport .m file from text file in VS2008 Pin
mohamadali&M18-Jan-10 18:10
mohamadali&M18-Jan-10 18:10 
AnswerRe: export .m file from text file in VS2008 Pin
Ashfield18-Jan-10 21:13
Ashfield18-Jan-10 21:13 
QuestionKeyEventArgs - differentiate control chars on numeric keypad [modified] Pin
cdesmarais18-Jan-10 12:21
cdesmarais18-Jan-10 12:21 
AnswerRe: KeyEventArgs - differentiate control chars on numeric keypad Pin
Luc Pattyn18-Jan-10 16:07
sitebuilderLuc Pattyn18-Jan-10 16:07 
Questionmanaged and unmanaged code............ Pin
3bood.ghzawi18-Jan-10 10:12
3bood.ghzawi18-Jan-10 10:12 
Hi all, pardon me, I need helping at the following code. When I run this code to get the IP address (at statement Console.WriteLine(ipAddress)) I get the IP address, subnet mask and network family at this maner:
169.254.25.129
255.255.0.0
255.255.255.255

but I need to get each of them uniqly (each one alone of others), and I need to get these using this code of the programe (this code from SharpPcap.2-1-1)….

Regards…………………………..

public Sockaddr(IntPtr sockaddrPtr)
{
// A sockaddr struct. We use this to determine the address family
PcapUnmanagedStructures.sockaddr saddr;

// Marshal memory pointer into a struct
saddr = (PcapUnmanagedStructures.sockaddr)Marshal.PtrToStructure(sockaddrPtr,
typeof(PcapUnmanagedStructures.sockaddr));

// record the sa_family for informational purposes
_sa_family = saddr.sa_family;

byte[] addressBytes;
if(saddr.sa_family == Pcap.AF_INET)
{

type = Type.AF_INET_AF_INET6;
PcapUnmanagedStructures.sockaddr_in saddr_in =
(PcapUnmanagedStructures.sockaddr_in)Marshal.PtrToStructure(sockaddrPtr, typeof(PcapUnmanagedStructures.sockaddr_in));
ipAddress = new System.Net.IPAddress(saddr_in.sin_addr.s_addr);
Console.WriteLine(ipAddress);

}
}// end of Sockaddr function

/////////////////////////////////////////////////////////////////////////////////
// A PcapUnmanagedStructures class is here:

public class PcapUnmanagedStructures
{
#region Unmanaged Structs Implementation


[StructLayout(LayoutKind.Sequential)]
public struct sockaddr
{
public UInt16 sa_family; /* address family */
[MarshalAs(UnmanagedType.ByValArray, SizeConst=14)]
public byte[] sa_data; /* 14 bytes of protocol address */
};

/// <summary>
/// Structure that holds an ipv4 address
/// </summary>
public struct in_addr
{
public UInt32 s_addr/*= 1111*/;
}

/// <summary>
/// Structure that holds an ipv4 address
/// 'struct sockaddr'
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct sockaddr_in
{
public UInt16 sa_family; /* address family */
public UInt16 sa_port; /* port */
public in_addr sin_addr; /* address */
// TODO: would be great to be able to have the compiler take care of this for us
// but I'm not sure how to

// pad the size of sockaddr_in out to 16 bytes
[MarshalAs(UnmanagedType.ByValArray, SizeConst=8)]
private byte[] pad;
};
}// end of the PcapUnmanagedStructures class
AnswerRe: managed and unmanaged code............ Pin
Not Active18-Jan-10 11:42
mentorNot Active18-Jan-10 11:42 
QuestionHow to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
GeniusMchlahla18-Jan-10 7:34
GeniusMchlahla18-Jan-10 7:34 
AnswerRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
J. Dunlap18-Jan-10 13:11
J. Dunlap18-Jan-10 13:11 
GeneralRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
GeniusMchlahla19-Jan-10 5:23
GeniusMchlahla19-Jan-10 5:23 
GeneralRe: How to Select Drawn Objects Without Getting a System.Windows.Forms.Control Pin
J. Dunlap19-Jan-10 6:27
J. Dunlap19-Jan-10 6:27 
QuestionEditing crystal reports at runtime Pin
kruegs3518-Jan-10 7:03
kruegs3518-Jan-10 7:03 

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.