getmessage.aspx
traceme.aspx
<%@ Page language="c#" Codebehind="traceme.aspx.cs" AutoEventWireup="false" Inherits="aspNetPingTest.traceme" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>traceme</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="pingme" method="post" runat="server">
<INPUT id=txtHost type=text runat="server" NAME="txtHost"><INPUT type=submit value=Trace ID="Submit1" NAME="Submit1">
<br> <PRE><asp:Literal id=TraceResults Runat="server"></asp:Literal></PRE>
</form>
</body>
</HTML>
traceme.aspx.cs
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 aspNetTraceRoute;
namespace aspNetPingTest
{
///
/// Summary description for pingme.
///
public class traceme : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Literal TraceResults;
protected System.Web.UI.HtmlControls.HtmlInputText txtHost;
private void Page_Load(object sender, System.EventArgs e)
{
if( Page.IsPostBack )
{
TraceRouteReplyCollection results = TraceRouteClient.Trace(txtHost.Value, 30, true );
TraceResults.Text = results.ToString();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}