Get IP Address in C#

Here is a little snippet of code I use in ASP.NET to get a client’s IP Address, handy to have this info if your web application is designed for certain countries or regions.

foreach (var rssItem in rss.Channel.Items.Take(6)) {
// do you thing to rssItem
}
Advertisements

Published by

Alan Feekery

Developer, Gamer, Musician, Cyclist and big Motorsport fan... enjoys the odd cup of coffee :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s