Click here to Skip to main content
15,916,180 members
Home / Discussions / C#
   

C#

 
QuestionCan you pass parameters to properties? Pin
inyoursadachine21-Jul-04 7:11
inyoursadachine21-Jul-04 7:11 
AnswerRe: Can you pass parameters to properties? Pin
Gary Thom21-Jul-04 8:27
Gary Thom21-Jul-04 8:27 
Generalweb services quest Pin
pelos21-Jul-04 6:42
pelos21-Jul-04 6:42 
GeneralRe: web services quest Pin
VenkatFor.NET21-Jul-04 7:08
VenkatFor.NET21-Jul-04 7:08 
GeneralRe: web services quest Pin
pelos21-Jul-04 12:49
pelos21-Jul-04 12:49 
GeneralReportingServicesWebServer Problem Pin
clydeJones21-Jul-04 6:26
clydeJones21-Jul-04 6:26 
GeneralC# equivalent for charCodeAt Pin
Mark Peters 2157521-Jul-04 4:56
Mark Peters 2157521-Jul-04 4:56 
GeneralRe: C# equivalent for charCodeAt Pin
Nick Parker21-Jul-04 5:49
protectorNick Parker21-Jul-04 5:49 
GeneralcharCodeAt equivalent in C# Pin
Mark Peters 2157521-Jul-04 4:46
Mark Peters 2157521-Jul-04 4:46 
QuestionHow to get the Internet IP Pin
sixefftee21-Jul-04 3:49
sixefftee21-Jul-04 3:49 
AnswerRe: How to get the Internet IP Pin
Nick Parker21-Jul-04 5:58
protectorNick Parker21-Jul-04 5:58 
AnswerRe: How to get the Internet IP Pin
Heath Stewart21-Jul-04 6:43
protectorHeath Stewart21-Jul-04 6:43 
GeneralRe: How to get the Internet IP Pin
Anonymous21-Jul-04 17:48
Anonymous21-Jul-04 17:48 
GeneralRe: How to get the Internet IP Pin
Broken God21-Jul-04 19:07
Broken God21-Jul-04 19:07 
GeneralRe: How to get the Internet IP Pin
Heath Stewart22-Jul-04 3:30
protectorHeath Stewart22-Jul-04 3:30 
AnswerRe: How to get the Internet IP Pin
TalkingBabb0t21-Jul-04 17:19
TalkingBabb0t21-Jul-04 17:19 
GeneralUser interface samples Pin
machocr21-Jul-04 2:51
machocr21-Jul-04 2:51 
GeneralRe: User interface samples Pin
Nick Parker21-Jul-04 3:04
protectorNick Parker21-Jul-04 3:04 
Generalnotify in taskmanager Pin
Ravikumar_mv21-Jul-04 1:53
Ravikumar_mv21-Jul-04 1:53 
GeneralRe: notify in taskmanager Pin
Ravikumar_mv21-Jul-04 1:59
Ravikumar_mv21-Jul-04 1:59 
GeneralRe: notify in taskmanager Pin
Heath Stewart21-Jul-04 6:40
protectorHeath Stewart21-Jul-04 6:40 
GeneralRe: notify in taskmanager Pin
Ravikumar_mv21-Jul-04 18:48
Ravikumar_mv21-Jul-04 18:48 
GeneralClosing Tcp connections // (for Axel Charpentier) Pin
Ahmad Mehrbod21-Jul-04 1:50
Ahmad Mehrbod21-Jul-04 1:50 
Hello.

I read the article "Getting active TCP/UDP connections on a box" in coldeproject.com.
My application get all tcp connections and should close user selected connections.
But I have 2 problems:

problem 1 : I want to close slelected port from Listening ports.
I wrote below code for it ,but this don't work properly:

[DllImport("iphlpapi.dll",SetLastError=true)]
public extern static int SetTcpEntry(IntPtr pTcpRow);

IPHlpAPI32Wrapper.MIB_TCPROW Kill=new IPHlpAPI32Wrapper.MIB_TCPROW();
IntPtr current= globaltablepointer;
//globaltablepointer poit to start of array of MIB_TCPROW structure
current=(IntPtr)((int) current+(listBox1.SelectedIndex*24));
Kill.dwstate = MIB_TCP_STATE_DELETE_TCB;
// iterate the pointer of 4
current = (IntPtr)((int)current+4);
Kill.dwLocalAddr=(int)Marshal.ReadIntPtr(current);
current = (IntPtr)((int)current+4);
Kill.dwLocalPort=(int)Marshal.ReadIntPtr(current);
current = (IntPtr)((int)current+4);
Kill.dwRemoteAddr=(int)Marshal.ReadIntPtr(current);
current = (IntPtr)((int)current+4);
Kill.dwRemotePort=(int)Marshal.ReadIntPtr(current);
IntPtr pt=Marshal.AllocHGlobal(Marshal.SizeOf(Kill));
Marshal.StructureToPtr(Kill,pt,true);
IPHelp.SetTcpEntry(pt);


problem 2 : What event happen when a port is opening.Is there any
message that I hook on it.



thanks

GeneralRe: Closing Tcp connections // (for Axel Charpentier) Pin
Heath Stewart21-Jul-04 6:34
protectorHeath Stewart21-Jul-04 6:34 
GeneralProblems with program start and install Pin
arjasepp21-Jul-04 0:51
arjasepp21-Jul-04 0:51 

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.