本文介绍了如何使用Asp.net跟踪系统IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Asp.net跟踪系统IP地址使用编码任何一个帮助帮助我?
How to trace the system IP Address using Asp.net With coding any one help help me ?
推荐答案
using System;
using System.Web;
namespace WebApplication1
{
public class Global : HttpApplication
{
protected void Application_BeginRequest(object sender, EventArgs e)
{
// Get request.
HttpRequest request = base.Request;
// Get UserHostAddress property.
string address = request.UserHostAddress;
// Write to response.
base.Response.Write(address);
// Done.
base.CompleteRequest();
}
}
}
也可以参考,
[]
[]
-KR
and refer this as well,
http://stackoverflow.com/questions/20027411/how-to-get-user-ip-address-in-asp-net[^]
http://stackoverflow.com/questions/735350/how-to-get-a-users-client-ip-address-in-asp-net[^]
-KR
这篇关于如何使用Asp.net跟踪系统IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!