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; }
查看全文
相关阅读:
12.19手动 项目部署
12.19 redis缓存
12.19 redis缓存
用压测模拟并发、并发处理(synchronized,redis分布式锁)
12.19 异常捕获补充
app提交版本更新的流程
变量
类型转换的判别
本文档中使用的伪类型
Callbacks
原文地址:https://www.cnblogs.com/javawebsoa/p/2458158.html
最新文章
Windows下MikTex+TexMaker中文化
Language Model
Linux Shell 脚本学习基础
Linux Shell 脚本
FlashCC学习笔记
vscode 常用插件安装
Clipboard.js移动端【ios】复制事件不生效解决方法
微信小程序 时间格式化处理方法【兼容ios】
react:redux_dev_tools的安装
npm install xxxxx 各种方式的 安装的区别
热门文章
vuex-mapState,mapGetters,mapMutations,mapActions 的使用方法
vue webpack配制 在生产环境清除console.log 排除console.warn
mpvue 小程序常用的一些插件 路由跳转mpvue-router-patch,数据请求flyio,vuex
vscode 需要安装的插件,配置
js 匹配 img标签 增加 style样式
Centos7 防火墙常用命令 开启 关闭防火墙
CentOS7 增加tomcat 启动,停止,使用systemctl进行配置
Linux文件查看/编辑方法介绍
在centos7下安装java8和mysql
12.21 Gson的常用用法 功能介绍 特点
Copyright © 2011-2022 走看看