/// <summary>
/// 获取本机公网IP
/// </summary>
/// <returns></returns>
public static string GetIP_Lan()
{
string tempip = "127.0.0.1";
try
{
WebRequest wr = WebRequest.Create("http://www.ip138.com/ip2city.asp");
Stream s = wr.GetResponse().GetResponseStream();
StreamReader sr = new StreamReader(s, Encoding.Default);
string all = sr.ReadToEnd();
int start = all.IndexOf("[") + ;
int end = all.IndexOf("]", start);
tempip = all.Substring(start, end - start);
sr.Close();
s.Close();
}
catch
{
}
return tempip;
}

最新文章

  1. acm结束了
  2. XPlane android 2D手游开发实战
  3. 支付宝集成后报错ALI38173
  4. delphi7 编译程序时报win32.indcu.a病毒的解决方法
  5. c#:Reflector+Reflexil 修改编译后的dll/exe文件
  6. IM客户端Socks 5代理协议应用
  7. VideoView
  8. Java基础知识强化之集合框架笔记75:哈希表
  9. .Net互操作2
  10. Pair of Numbers
  11. Qt 错误汇集贴
  12. 在网页中获取 facebook page 的内容
  13. vue指令v-if示例解析
  14. HashMap实现分析
  15. linux常用命令合集(未完)
  16. 理解 docker 容器中的 uid 和 gid
  17. Automated EBS Snapshots using AWS Lambda &amp; CloudWatch
  18. dbms_redefinition在线重定义表结构 可以在表分区的时候使用
  19. php中json_decode及foreach使用总结
  20. Struts2 框架使用 核心以及其他详细配置

热门文章

  1. Django 静态文件配置(static files)
  2. 使用VS2013逆向生成UML类图
  3. 通过rem编写自适应移动端要点
  4. 在iframe中使用cookie需要注意
  5. C# 利用反射给不同类型对象同名属性赋值
  6. 17.linux下root用户与普通用户
  7. 为 Linux 应用程序编写 DLL[转]
  8. Ubuntu 12.04搭建l2tp服务器记录。
  9. Gson运用
  10. AngularJS 2 VS Code Linter环境设置