programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Tuesday, February 21, 2017

Find client IP Address of user in C#?

How to find client IP Address of user in C#

Finding the User Machine IP is a very basic thing. Why would it become a necessity? It starts when a developer builds an application where they need to track the status of visitor that is viewing its application. At that, time knowing the user Machine IP becomes a matter of security and identifying the user location.

Let’s see some direct way in which we can find the IP Address.

1: Create a New Website. Add a Web Form (GetIPAddress.aspx).
2: Add a new Web Form. Prepare a layout design with 2 Label controls. code find client IP Address of user in C#

Web Form (Source Code)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetIPAddress.aspx.cs"Inherits="GetIPAddress" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <div style="width:190px; height:180px; border:7px groove; padding-left:20px;">
    <h3 style="color:Orange; font-weight:bold;"><u>GET IP ADDRESS</u></h3>
    <br />
        <asp:Label ID="Label1" runat="server" Text="Label-1" Font-Bold="true"ForeColor="Green"></asp:Label><br />
        <asp:Label ID="Label2" runat="server" Text="Label-2" Font-Bold="true"ForeColor="Chocolate"></asp:Label>

3: Debug(CTRL+SHIFT+B). Check for compile error if any.
4: On Build succeeded. Run(CTRL+F6).
5: See the output window. Both labels are shown.

Related Post :

No comments:

Post a Comment