本文介绍了如何存储客户端计算机的IP地址.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将客户端计算机的IP地址存储到我的数据库中,而无需用户交互.我想自动捕获客户端计算机的IP地址并将其存储到数据库中,我该如何做到这一点?我只想跟踪更新数据所用的IP地址.
Hi,
I want to store IP address of client machine to my database.without user interaction . automatically i want to capture IP address of client machine and get stored it into database how do i accomplish this?. I just want to keep track of IP address by which data has been updated.
Thanks
推荐答案
string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { ''.'' });
txt_ipaddress.Text = strClientIP.ToString() + "[" + computer_name[0].ToString() +"]";
获取IP后,您可以将其存储在数据库中.
谢谢,
帕旺
after getting IP you can store it in Database.
Thanks ,
Pawan
这篇关于如何存储客户端计算机的IP地址.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!