当前位置:网站首页>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 .
边栏推荐
- 22年多校第三场(F的证明
- Unity shader realizes water wave effect with noise texture
- Proof of the third scene (f) in 22 years
- C# 导入Excel文件数据的几种方法
- Round 1A 2022 - Code jam 2022 c.weightlifting (interval DP)
- Verilog 每日一题(VL6 数据串转并电路)
- 侦察机与预警机的区别
- Verilog 每日一题(VL2 异步复位的串联T触发器--牛客网)
- WPF command button transparent style
- Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021
猜你喜欢

kubernetes service 原理解析

Asynchronous circuit design -- principle and example of synchronous pulser

Unity3d shader achieves ablation effect

How to protect image security during construction

Introduction to vscade interface

System clock failure of database fault tolerance

Problem solution of code heartstrings Junior Group (official competition) of Dalian University of Technology (Development Zone campus) in 2021

Proof of the third scene (f) in 22 years

Verilog daily question (vl27 settable counter)

【presto 】presto 新版本升级详情
随机推荐
The practice of beego framework in goweb development: Section I Introduction to beego framework
【impala】【报错解决】 Impala cannot read or execute the parent directory of dfs.domain.socket.path的解决方法
Azure Devops developed by visual studio 2015 team
Visual studio 2012/2015 releases web applications together with.Cs source code
valarray数值库学习
线性代数及矩阵论(七)
【kibana】问题整理 kibana 7.x No indices match pattern “apm-*“
Verilog daily question (vl5 signal generator)
异步FIFO基本原理(基于Verilog的简单实现)
火了 2 年的服务网格究竟给微服务带来了什么?(转载)
Unity shader texture animation
部分情况下Error:(xx, xx) Failed to resolve: xxxxxx解决。
Role of Fortress machine
Verilog daily question (vl27 settable counter)
一文了解 Kubernetes 中的服务发现
Some attention code explanations
net框架
Shopee code League 2022 - qualification round p3.connecting the numbers (segment tree / bipartite graph determination, to be discussed)
Pytorch Foundation: similarities and differences between torch.mul, torch.mm and torch.matmul
MySQL数据库增删改查(基础操作命令详解)