zoukankan
html css js c++ java
通过外部网站返回得到内网外部IP
static string GetIP() { Uri uri = new Uri("http://www.ikaka.com/ip/index.asp";); System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = 0; req.CookieContainer = new System.Net.CookieContainer(); req.GetRequestStream().Write(new byte [0], 0, 0); System.Net.HttpWebResponse res = (System.Net.HttpWebResponse)(req.GetResponse()); StreamReader rs = new StreamReader(res.GetResponseStream(), System.Text.Encoding.GetEncoding("GB18030")); string s = rs.ReadToEnd(); rs.Close(); req.Abort(); res.Close(); System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(s, @"IP:/[(?<IP>[0-9/.]*)/]"); if (m.Success) return m.Groups["IP"].Value; return string.Empty; }
查看全文
相关阅读:
02动手动脑
动手动脑01
千锤百炼软工6,7,8
千锤百炼软工10.5
千锤百炼软工10.4
千锤百炼软工10.3
千锤百炼软工10.2
千锤百炼软工10.1
千锤百炼软工9.30
破解 webstorm
原文地址:https://www.cnblogs.com/javawebsoa/p/2458158.html
最新文章
CenterMask论文记录和模型训练
自然语言处理工具之spaCy
KDD 数据预处理之数据标准化和缺失值补充
WeTest五周年 |“领航者”的破浪之路:诞生
【内测来袭】PerfDogService 一键搭建您的性能测试平台
Game AI SDK开源版本发布:基于图像的游戏场景自动化框架
WeTest明星工具-移动端性能测试PerfDog初探
移动端性能测试必备工具PerfDog性能狗
实战PerfDog优化小游戏性能
QNET:APP弱网络测试专家
热门文章
hive 内部表和外部表
mysql的slow log分析
python如何方便地修改第三方库--父类继承
hive插入各类型数据语法
mysql两表联查概念
Impala中的刷新元数据和刷新表
mysql计算百分比
sqlmap使用
消息队列学习(1)
千锤百炼软工9,11,12
Copyright © 2011-2022 走看看