当前位置:网站首页>Wechat applet cash red packet returns the error "the IP address is not the available IP address you set on the merchant platform". The ultimate solution
Wechat applet cash red packet returns the error "the IP address is not the available IP address you set on the merchant platform". The ultimate solution
2022-07-28 17:25:00 【mojocube】
Baidu searched , There is no fundamental solution ( The premise is that the allowed... Has been set on the merchant platform IP), It's a hint IP The address is not yours ... Error prompt for ,PS: Despise Tencent , Since you all know me IP What is it? , Why don't you directly tell me the truth when you return the information IP Address .

There are similar solutions :

But actually this IP It's not my truth IP, Because of virtual routing or proxy and other means , Can't get the truth IP Address, etc .
Then how can we get those that really meet the requirements of wechat IP Well , Look at the code below :
public string getTrueIP()
{
String direction = "";
string url = "http://checkip.dyndns.org/";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "PROPFIND";
request.ContentType = "application/x-www-form-urlencoded;charset:utf-8";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream stream = response.GetResponseStream();
using (StreamReader streamReader = new StreamReader(stream, Encoding.UTF8))
{
direction = streamReader.ReadToEnd().ToString();
}
}
//Search for the ip in the html
int first = direction.IndexOf("Address: ") + 9;
int last = direction.LastIndexOf("</body>");
direction = direction.Substring(first, last - first);
return direction;
}Execute this code on the server , Request a third-party tool to obtain the real of this server IP, Put this IP Add it to the merchant platform , solve .
边栏推荐
- Janus series article 3 API usage guide videoroom creating a new video room
- Classroom attendance system based on QT design (using RDS for MySQL cloud database)
- 线性代数及矩阵论(十)
- Vscode界面介绍
- The practice of beego framework in goweb development: Section I Introduction to beego framework
- 部分情况下Error:(xx, xx) Failed to resolve: xxxxxx解决。
- 数据库故障容错之系统时钟故障
- 全链路灰度在数据库上我们是怎么做的?
- Steps to configure V530 switch
- Proof of the third scene (f) in 22 years
猜你喜欢

微服务架构-服务注册中心和服务网关(6.8) (转载)

The practice of beego framework developed by goweb: Section 4 database configuration and connection

Analysis of kubernetes service principle

mysql 最大建议行数2000w,靠谱吗?

Goweb开发之Beego框架实战:第二节 项目初始化配置

High speed circuit design practice -- Overview

Goweb开发之Beego框架实战:第四节 数据库配置及连接

Verilog daily question (vl27 settable counter)

GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification

The practice of beego framework developed by goweb: Section 4 database configuration and connection
随机推荐
Codeforces round 770 (Div. 2) e. fair share
Andthen of function interface
LNMP源码编译安装
Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)
数据库故障容错之系统时钟故障
Basic principle of asynchronous FIFO (simple implementation based on Verilog)
一文了解 Kubernetes 中的服务发现
GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification
Atcoder beginer contest 240 g.reporting Takahashi (classical problems of Combinatorial Mathematics)
The practice of the beego framework for goweb development: Section V project construction and user registration
【CDH】通过 ClouderaManager 配置CDH组件用 prometheus 监控采集JMX信息
【sqoop】sqoop1.4.7 安装集成CDH5.13
Using SQL server agent job to restore the database regularly
Goweb开发之Beego框架实战:第五节 项目搭建及注册用户
Analysis of browser decoding process
Use of influxdb2
【ansible】ansible shell 执行远程命令遇到awk 中$符号的问题
List of supplementary questions
创建自定义分页控件
线性代数及矩阵论(八)