using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Net;
namespace WebApplication5
{
/// <summary>
/// WebForm1 The summary description of.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
private void Page_Load(object sender, System.EventArgs e)
{
// Place user code here to initialize the page
string strHostIP="";
IPHostEntry oIPHost=Dns.Resolve(Environment.MachineName);
if(oIPHost.AddressList.Length>0)
strHostIP=oIPHost.AddressList[0].ToString();
this.TextBox1.Text=strHostIP;
}
#region Web Code generated by the forms designer
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: The call is ASP.NET Web Required by the Forms designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// The designer supports the required methods - Do not modify using the code editor
/// The contents of this method.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}