473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Extracting IP Address - C#

Hello All,

I use .AcceptTcpClient method of a TcpListener object. My question is how
can I extract the IP address of the client that was accepted by the server?

Thanks!
Tom.
Nov 22 '05 #1
1 1961
Hi Tom,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the client IP address
in AcceptTcpClient method. If there is any misunderstanding, please feel
free to let me know.

As far as I know, AcceptTcpClient method returns a TcpClient object. This
object didn't expose a method for us to get the endpoint. However, there is
a protected property Client, which you can use Reflection to get. To obtain
more flexibility, I suggest you use AcceptSocket method, which returns a
Socket object. You will get the IP address using LocalEndPoint directly.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lecichy | last post by:
Hello Heres the situation: I got a file with lines like: name:second_name:somenumber:otherinfo etc with different values between colons ( just like passwd file) What I want is to extract...
5
by: Astra | last post by:
Hi All Is there an ASP way of extracting the height and width of a swf file so that I can specify these dims when adding the whole OBJECT code to the web page? Thanks Robbie
1
by: Tom Rahav | last post by:
Hello All, I use .AcceptTcpClient method of a TcpListener object. My question is how can I extract the IP address of the client that was accepted by the server? Thanks! Tom.
7
by: Raphi | last post by:
Hi, I'm trying to clean up a large database in Access. I have one field for address, which needs to be broken up into Street Number, Street Name, and Street Label (St., Road, etc.) The...
36
by: Digital Puer | last post by:
Hi, suppose I have an unsigned long long. I would like to extract the front 'n' bits of this value and convert them into an integer. For example, if I extract the first 3 bits, I would get an int...
4
by: davidiwharper | last post by:
Hi everyone, I am rewriting a basic "email data to administrator" script to include an error check, which will ensure that all fields are filled with at least some data. However, there is a...
0
jawaharcsc
by: jawaharcsc | last post by:
Hi Friends,, Im new to exchange server, I want to extract the Public address list (GAL) from exchange server through .net(C# application.) and store it in arraylist to compare the mail address in...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
1
by: Edsel | last post by:
Hi all, Can anyone help with this? I would like to extract the attributes from a XML node and then transform them back to XML as elements using XSLT? <unsorted> <office...
14
by: Gordon Allott | last post by:
Hello :) The result of various incompatibilities has left me needing to somehow extract the address that a null pointer is pointing to with the null pointer being exposed to python via...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.