我的IP地址将如何自动出现在texbox中 [英] How my ip address will come automatically in a texbox
本文介绍了我的IP地址将如何自动出现在texbox中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在页面调用查询中有一个文本框。
i想要当我的页面加载我的IP地址时会自动进入该texbox ...请帮助我。 .i需要尽快给你建议。
I have a textbox in a page call enquiry.
i want when my page loads my ip address will come automatically in that texbox... please help me..i need your suggestions as soon as possible .
推荐答案
如果你正在寻找C#代码然后参考
如何在C#中获取用户的公共IP地址
for asp.net代码参考
使用ASP.NET检索用户的IP地址(带示例代码)
从中获取一些想法这个例子和调用函数直接在page_load事件上
if you are looking for C# code then refer
How to get Public Ip address of a user in C#
for asp.net code refer
Retrieving User's IP Address using ASP.NET (with sample code)
Get some idea from this examples and call function directly on page_load event
试试这是在我身边工作
Try This it is working my side
string host = Dns.GetHostName();
IPHostEntry ip = Dns.GetHostEntry(host);
TextBox1.Text= ip.AddressList[1].ToString();
这篇关于我的IP地址将如何自动出现在texbox中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文