├── .gitattributes
├── .gitignore
├── README.md
├── WeChatTools
├── .gitignore
├── .vs
│ └── config
│ │ └── applicationhost.config
├── WeChatTools.API
│ ├── 404.html
│ ├── Config
│ │ ├── CheckKey.config
│ │ ├── Other.config
│ │ └── site.config
│ ├── Lib
│ │ ├── Newtonsoft.Json.dll
│ │ ├── ServiceStack.Common.dll
│ │ ├── ServiceStack.Common.xml
│ │ ├── ServiceStack.Interfaces.dll
│ │ ├── ServiceStack.Redis.dll
│ │ ├── ServiceStack.Redis.xml
│ │ ├── ServiceStack.Text.dll
│ │ └── ServiceStack.Text.xml
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── WeChatTools.API.csproj
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ ├── api
│ │ ├── DomainAPI.ashx
│ │ ├── DomainAPI.ashx.cs
│ │ ├── DomainSetByKey.aspx
│ │ ├── DomainSetByKey.aspx.cs
│ │ ├── DomainSetByKey.aspx.designer.cs
│ │ ├── jsonpHandler.ashx
│ │ └── jsonpHandler.ashx.cs
│ ├── dev
│ │ ├── hdShowImg.ashx
│ │ ├── hdShowImg.ashx.cs
│ │ ├── qzoneH5.ashx
│ │ ├── qzoneH5.ashx.cs
│ │ ├── shorturl.ashx
│ │ └── shorturl.ashx.cs
│ ├── pro
│ │ ├── dyUrlCheck.ashx
│ │ ├── dyUrlCheck.ashx.cs
│ │ ├── dyUrlCheck2.ashx
│ │ ├── dyUrlCheck2.ashx.cs
│ │ ├── icpCheck.ashx
│ │ ├── icpCheck.ashx.cs
│ │ ├── icpCheck2.ashx
│ │ ├── icpCheck2.ashx.cs
│ │ ├── qqUrlCheck.ashx
│ │ ├── qqUrlCheck.ashx.cs
│ │ ├── qqUrlCheck2.ashx
│ │ ├── qqUrlCheck2.ashx.cs
│ │ ├── shorturl.ashx
│ │ ├── shorturl.ashx.cs
│ │ ├── shorturl3.ashx
│ │ ├── shorturl3.ashx.cs
│ │ ├── wxMiNiProCheck.ashx
│ │ ├── wxMiNiProCheck.ashx.cs
│ │ ├── wxMiNiProCheck2.ashx
│ │ ├── wxMiNiProCheck2.ashx.cs
│ │ ├── wxUrlCheck.ashx
│ │ ├── wxUrlCheck.ashx.cs
│ │ ├── wxUrlCheck2.ashx
│ │ ├── wxUrlCheck2.ashx.cs
│ │ ├── wxUrlCheck3.ashx
│ │ └── wxUrlCheck3.ashx.cs
│ ├── tools
│ │ ├── hdBase64.ashx
│ │ ├── hdBase64.ashx.cs
│ │ ├── hdUrlEncode.ashx
│ │ └── hdUrlEncode.ashx.cs
│ └── wap2wx.html
├── WeChatTools.Core
│ ├── ConfigTool.cs
│ ├── HttpHelper.cs
│ ├── LogTools.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RedisCacheToolsYUN0.cs
│ ├── RedisCacheToolsYUN1.cs
│ ├── ServiceApi.cs
│ ├── ToolsBase64.cs
│ ├── WeChatTools.Core.csproj
│ └── WeiXinUrlCheck.cs
├── WeChatTools.UI
│ ├── .gitignore
│ ├── 404.html
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── WeChatTools.UI.csproj
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ ├── checklist.html
│ ├── contact.html
│ ├── css
│ │ ├── bootstrap.min.css
│ │ ├── checklist.css
│ │ ├── font-awesome.min.css
│ │ ├── layer.css
│ │ └── main.css
│ ├── doc.html
│ ├── faq.html
│ ├── fonts
│ │ ├── fontawesome-webfont.svg
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ └── fontawesome-webfont.woff2
│ ├── img
│ │ ├── alipay.jpg
│ │ ├── bg.jpg
│ │ ├── favicon.ico
│ │ ├── icon-ext.png
│ │ ├── icon.png
│ │ ├── loading-0.gif
│ │ ├── loading-1.gif
│ │ ├── loading-2.gif
│ │ ├── thumbnail.jpg
│ │ └── webchat.jpg
│ ├── index.html
│ ├── js
│ │ ├── bootstrap.min.js
│ │ ├── html5shiv.min.js
│ │ ├── jquery.min.js
│ │ ├── layer.js
│ │ └── respond.min.js
│ ├── price.html
│ ├── wap2wx.html
│ └── wx.html
└── WeChatTools.sln
├── doc
├── .gitignore
├── README.md
├── get-weixin-code.html
├── pkg
│ ├── PKGDecode.py
│ └── PKGEncode.py
└── 微信域名检测接口调用文档.doc
└── 微信小程序状态检测接口.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=C#
2 | *.css linguist-language=C#
3 | *.html linguist-language=C#
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Dd]ebugPublic/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | bld/
16 | [Bb]in/
17 | [Oo]bj/
18 | HNCanYou.bin/
19 | api/
20 | site.config
21 | RedisCacheToolsYUN*.cs
22 | # Roslyn cache directories
23 | *.ide/
24 |
25 | # MSTest test Results
26 | [Tt]est[Rr]esult*/
27 | [Bb]uild[Ll]og.*
28 |
29 | #NUNIT
30 | *.VisualState.xml
31 | TestResult.xml
32 |
33 | # Build Results of an ATL Project
34 | [Dd]ebugPS/
35 | [Rr]eleasePS/
36 | dlldata.c
37 |
38 | *_i.c
39 | *_p.c
40 | *_i.h
41 | *.ilk
42 | *.meta
43 | *.obj
44 | *.pch
45 | *.pdb
46 | *.pgc
47 | *.pgd
48 | *.rsp
49 | *.sbr
50 | *.tlb
51 | *.tli
52 | *.tlh
53 | *.tmp
54 | *.tmp_proj
55 | *.log
56 | *.vspscc
57 | *.vssscc
58 | .builds
59 | *.pidb
60 | *.svclog
61 | *.scc
62 |
63 | # Chutzpah Test files
64 | _Chutzpah*
65 |
66 | # Visual C++ cache files
67 | ipch/
68 | *.aps
69 | *.ncb
70 | *.opensdf
71 | *.sdf
72 | *.cachefile
73 |
74 | # Visual Studio profiler
75 | *.psess
76 | *.vsp
77 | *.vspx
78 |
79 | # TFS 2012 Local Workspace
80 | $tf/
81 |
82 | # Guidance Automation Toolkit
83 | *.gpState
84 |
85 | # ReSharper is a .NET coding add-in
86 | _ReSharper*/
87 | *.[Rr]e[Ss]harper
88 | *.DotSettings.user
89 |
90 | # JustCode is a .NET coding addin-in
91 | .JustCode
92 |
93 | # TeamCity is a build add-in
94 | _TeamCity*
95 |
96 | # DotCover is a Code Coverage Tool
97 | *.dotCover
98 |
99 | # NCrunch
100 | _NCrunch_*
101 | .*crunch*.local.xml
102 |
103 | # MightyMoose
104 | *.mm.*
105 | AutoTest.Net/
106 |
107 | # Web workbench (sass)
108 | .sass-cache/
109 |
110 | # Installshield output folder
111 | [Ee]xpress/
112 |
113 | # DocProject is a documentation generator add-in
114 | DocProject/buildhelp/
115 | DocProject/Help/*.HxT
116 | DocProject/Help/*.HxC
117 | DocProject/Help/*.hhc
118 | DocProject/Help/*.hhk
119 | DocProject/Help/*.hhp
120 | DocProject/Help/Html2
121 | DocProject/Help/html
122 |
123 | # Click-Once directory
124 | publish/
125 |
126 | # Publish Web Output
127 | *.[Pp]ublish.xml
128 | *.azurePubxml
129 | ## TODO: Comment the next line if you want to checkin your
130 | ## web deploy settings but do note that will include unencrypted
131 | ## passwords
132 | *.pubxml
133 |
134 | # NuGet Packages Directory
135 | packages/*
136 | ## TODO: If the tool you use requires repositories.config
137 | ## uncomment the next line
138 | #!packages/repositories.config
139 |
140 | # Enable "build/" folder in the NuGet Packages folder since
141 | # NuGet packages use it for MSBuild targets.
142 | # This line needs to be after the ignore of the build folder
143 | # (and the packages folder if the line above has been uncommented)
144 | !packages/build/
145 |
146 | # Windows Azure Build Output
147 | csx/
148 | *.build.csdef
149 |
150 | # Windows Store app package directory
151 | AppPackages/
152 |
153 | # Others
154 | sql/
155 | *.Cache
156 | ClientBin/
157 | [Ss]tyle[Cc]op.*
158 | ~$*
159 | *~
160 | *.dbmdl
161 | *.dbproj.schemaview
162 | *.pfx
163 | *.publishsettings
164 | node_modules/
165 |
166 | # RIA/Silverlight projects
167 | Generated_Code/
168 |
169 | # Backup & report files from converting an old project file
170 | # to a newer Visual Studio version. Backup files are not needed,
171 | # because we have git ;-)
172 | _UpgradeReport_Files/
173 | Backup*/
174 | UpgradeLog*.XML
175 | UpgradeLog*.htm
176 |
177 | # SQL Server files
178 | *.mdf
179 | *.ldf
180 |
181 | # Business Intelligence projects
182 | *.rdl.data
183 | *.bim.layout
184 | *.bim_*.settings
185 |
186 | # Microsoft Fakes
187 | FakesAssemblies/
188 |
189 | # LightSwitch generated files
190 | GeneratedArtifacts/
191 | _Pvt_Extensions/
192 | ModelManifest.xml
193 | /WeChatTools/WeChatTools.UI/static/styles/head.css
194 | /WeChatTools/WeChatTools.UI/static/styles/foot.css
195 | /WeChatTools/WeChatTools.UI/static/styles/base1.css
196 | /WeChatTools/WeChatTools.UI/img/logo_word.png
197 | /WeChatTools/WeChatTools.UI/test.html
198 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信工具集
2 | [](LICENSE)
3 | [](https://github.com/gemgin/WeChatTools/pulls)
4 | [](https://github.com/gemgin/WeChatTools)
5 | [](https://github.com/gemgin/WeChatTools)
6 |
7 | [交流QQ群:20772662](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=IeDjmP0tr9iYWunmNVU7LzAXcgH-h01H&authKey=7oy9vFrVLwRJhCa6Gpl5A6Ia5k%2FDENWfqEmq%2F8UWzRHtHcvRv0PIrSpoAFEp1PLE&noverify=0&group_code=20772662 "QQ群:20772662"),[QQ:391502069](http://wpa.qq.com/msgrd?v=3&uin=391502069&site=qq&menu=yes "QQ:391502069")
8 |
9 | ## 项目介绍
10 | > 微信域名检测
11 | - 实时检测域名能否在微信中直接访问的技术
12 |
13 |
14 | ## 使用
15 | - 微信域名检测试用接口 [http://wx.rrbay.com/pro/wxUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/wxUrlCheck.ashx?url=http://www.teu7.cn "微信域名检测试用接口")
16 | - QQ域名检测试用接口 [http://wx.rrbay.com/pro/qqUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/qqUrlCheck.ashx?url=http://www.teu7.cn "QQ域名检测试用接口")
17 | - 微信小程序状态检测试用接口 [http://wx.rrbay.com/pro/wxMiNiProCheck.ashx?appid=wxd123456789abcdef](http://wx.rrbay.com/pro/wxMiNiProCheck.ashx?appid=wxd123456789abcdef "微信小程序状态检测试用接口")
18 | - 抖音域名检测试用接口 [http://wx.rrbay.com/pro/dyUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/dyUrlCheck.ashx?url=http://www.teu7.cn "抖音域名检测试用接口")
19 | - 域名备案查询接口 [http://wx.rrbay.com/pro/icpCheck.ashx?url=qq.com](http://wx.rrbay.com/pro/icpCheck.ashx?url=qq.com "域名备案查询接口")
20 | ```
21 | {"State":true, "Code","101","Data":"www.teu7.cn", "Msg":"屏蔽"}
22 | {"State":true, "Code","102","Data":"www.wxcheckurl.com","Msg":"正常"}
23 | {"State":true, "Code","103","Data":"www.wxcheckurl.com","Msg":"检测结果为空,请重试!"}
24 | {"State":false,"Code","001","Data":"www.wxcheckurl.com","Msg":"非法访问,访问被拒绝,联系管理员qq:391502069"}
25 | {"State":false,"Code","002","Data":"www.wxcheckurl.com","Msg":"歇一歇,访问太快了,联系管理员qq:391502069"}
26 | {"State":false,"Code","003","Data":"www.wxcheckurl.com","Msg":"服务暂停,请联系管理员!"}
27 | ```
28 | - 域名检测界面:http://h5.wxcheckurl.com/
29 |
30 | ### 顶尖技术,铸就稳定服务
31 |
32 | 微信域名检测接口采用基于系统服务开发,接口快速、稳定。
33 |
34 | ### 官方接口,实时结果
35 |
36 | 微信域名检测采用官方接口,实时返回查询结果,准确率99.99%,API接口响应速度快,平均检测时间只需0.2秒
37 |
38 | ### 在线自助查询/API集成查询
39 |
40 | 微信域名检测接口支持多域名不限次数提交查询,web端在线查询返回结果,无需安装插件或客户端。支持API查询、支持集成到自由系统或第三方系统
41 |
42 | ### 为用户定制的域名自动监测系统
43 |
44 | > 积攒star=18000,微信域名检测核心代码和原理将在码云和github完全公开,如果你需要请star
45 |
46 | ## 2018-01-29 微信域名检测系统升级说明
47 | - 数据库mongodb连接安全问题(部署不当,会造成重大安全漏洞)
48 | - 微信域名检测key授权与微信域名检测服务分离,方便部署和后期运营
49 | - 优化微信域名检测服务接口
50 | - 检测入口分布式部署以及负载均衡
51 |
52 | ## 2018-08-20 微信链接推广系统升级说明
53 | - 推广系统接收中转分离
54 | - 中转统一采用redis
55 | - 优化实时检测自动更换逻辑--采用每个小时检测某分钟检测
56 |
57 | ## 2018-08-23 微信域名检测系统升级说明
58 | - 微信域名检测底层服务升级改造
59 | - 采集cookie与检测服务分离
60 | - redis与mongodb分离
61 |
62 | ## 2018-12-17 微信域名检测系统升级说明
63 | - 微信域名监测服务上线
64 | - 域名qq检测上线
65 | - 同一个key可以微信检测,qq检测以及微信域名监测结果微信通知
66 |
67 | ## 2019-09-29 微信域名检测系统升级说明
68 | - 域名备案信息查询服务上线
69 | - 同一个key可以微信检测,qq检测以及域名备案信息查询
70 |
71 | ## 2021-04-19 域名检测系统升级说明
72 | - 抖音域名安全检测接口上线
73 | - 同一个key可以微信检测,qq检测,抖音域名检测以及域名备案信息查询
74 |
75 | ## 2022-05-24 检测系统升级说明
76 | - 微信小程序状态检测接口上线
77 | - 同一个key可以微信检测,微信小程序状态,qq检测,抖音域名检测以及域名备案信息查询
78 |
79 | ## 2024-01-15 微信域名检测接口升级
80 | - 微信域名检测接口升级
81 |
--------------------------------------------------------------------------------
/WeChatTools/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Dd]ebugPublic/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | bld/
16 | [Bb]in/
17 | [Oo]bj/
18 | HNCanYou.bin/
19 |
20 | # Roslyn cache directories
21 | *.ide/
22 |
23 | # MSTest test Results
24 | [Tt]est[Rr]esult*/
25 | [Bb]uild[Ll]og.*
26 |
27 | #NUNIT
28 | *.VisualState.xml
29 | TestResult.xml
30 |
31 | # Build Results of an ATL Project
32 | [Dd]ebugPS/
33 | [Rr]eleasePS/
34 | dlldata.c
35 |
36 | *_i.c
37 | *_p.c
38 | *_i.h
39 | *.ilk
40 | *.meta
41 | *.obj
42 | *.pch
43 | *.pdb
44 | *.pgc
45 | *.pgd
46 | *.rsp
47 | *.sbr
48 | *.tlb
49 | *.tli
50 | *.tlh
51 | *.tmp
52 | *.tmp_proj
53 | *.log
54 | *.vspscc
55 | *.vssscc
56 | .builds
57 | *.pidb
58 | *.svclog
59 | *.scc
60 |
61 | # Chutzpah Test files
62 | _Chutzpah*
63 |
64 | # Visual C++ cache files
65 | ipch/
66 | *.aps
67 | *.ncb
68 | *.opensdf
69 | *.sdf
70 | *.cachefile
71 |
72 | # Visual Studio profiler
73 | *.psess
74 | *.vsp
75 | *.vspx
76 |
77 | # TFS 2012 Local Workspace
78 | $tf/
79 |
80 | # Guidance Automation Toolkit
81 | *.gpState
82 |
83 | # ReSharper is a .NET coding add-in
84 | _ReSharper*/
85 | *.[Rr]e[Ss]harper
86 | *.DotSettings.user
87 |
88 | # JustCode is a .NET coding addin-in
89 | .JustCode
90 |
91 | # TeamCity is a build add-in
92 | _TeamCity*
93 |
94 | # DotCover is a Code Coverage Tool
95 | *.dotCover
96 |
97 | # NCrunch
98 | _NCrunch_*
99 | .*crunch*.local.xml
100 |
101 | # MightyMoose
102 | *.mm.*
103 | AutoTest.Net/
104 |
105 | # Web workbench (sass)
106 | .sass-cache/
107 |
108 | # Installshield output folder
109 | [Ee]xpress/
110 |
111 | # DocProject is a documentation generator add-in
112 | DocProject/buildhelp/
113 | DocProject/Help/*.HxT
114 | DocProject/Help/*.HxC
115 | DocProject/Help/*.hhc
116 | DocProject/Help/*.hhk
117 | DocProject/Help/*.hhp
118 | DocProject/Help/Html2
119 | DocProject/Help/html
120 |
121 | # Click-Once directory
122 | publish/
123 |
124 | # Publish Web Output
125 | *.[Pp]ublish.xml
126 | *.azurePubxml
127 | ## TODO: Comment the next line if you want to checkin your
128 | ## web deploy settings but do note that will include unencrypted
129 | ## passwords
130 | *.pubxml
131 |
132 | # NuGet Packages Directory
133 | packages/*
134 | ## TODO: If the tool you use requires repositories.config
135 | ## uncomment the next line
136 | #!packages/repositories.config
137 |
138 | # Enable "build/" folder in the NuGet Packages folder since
139 | # NuGet packages use it for MSBuild targets.
140 | # This line needs to be after the ignore of the build folder
141 | # (and the packages folder if the line above has been uncommented)
142 | !packages/build/
143 |
144 | # Windows Azure Build Output
145 | csx/
146 | *.build.csdef
147 |
148 | # Windows Store app package directory
149 | AppPackages/
150 |
151 | # Others
152 | sql/
153 | *.Cache
154 | ClientBin/
155 | [Ss]tyle[Cc]op.*
156 | ~$*
157 | *~
158 | *.dbmdl
159 | *.dbproj.schemaview
160 | *.pfx
161 | *.publishsettings
162 | node_modules/
163 |
164 | # RIA/Silverlight projects
165 | Generated_Code/
166 |
167 | # Backup & report files from converting an old project file
168 | # to a newer Visual Studio version. Backup files are not needed,
169 | # because we have git ;-)
170 | _UpgradeReport_Files/
171 | Backup*/
172 | UpgradeLog*.XML
173 | UpgradeLog*.htm
174 |
175 | # SQL Server files
176 | *.mdf
177 | *.ldf
178 |
179 | # Business Intelligence projects
180 | *.rdl.data
181 | *.bim.layout
182 | *.bim_*.settings
183 |
184 | # Microsoft Fakes
185 | FakesAssemblies/
186 |
187 | # LightSwitch generated files
188 | GeneratedArtifacts/
189 | _Pvt_Extensions/
190 | ModelManifest.xml
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 404
5 |
6 |
7 |
8 |
9 |
10 |
11 |
54 |
63 |
64 |
65 |
66 |

67 |
正在跳转到微信
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Config/CheckKey.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Config/Other.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Config/site.config:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Lib/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.API/Lib/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Lib/ServiceStack.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.API/Lib/ServiceStack.Common.dll
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Lib/ServiceStack.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.API/Lib/ServiceStack.Interfaces.dll
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Lib/ServiceStack.Redis.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.API/Lib/ServiceStack.Redis.dll
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Lib/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.API/Lib/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制.更改这些特性值可修改
7 | // 与程序集关联的信息.
8 | [assembly: AssemblyTitle("WeChatTools.API")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WeChatTools.API")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见.如果需要
19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true.
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
23 | [assembly: Guid("cf5d7f57-1470-491e-932c-ef0169ba6f5c")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订版本
31 | //
32 | // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用 "*":
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/DomainAPI.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="DomainAPI.ashx.cs" Class="WeChatTools.API.DomainAPI" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/DomainAPI.ashx.cs:
--------------------------------------------------------------------------------
1 | using WeChatTools.Core;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Collections.Specialized;
5 | using System.Linq;
6 | using System.Web;
7 |
8 | namespace WeChatTools.API
9 | {
10 | ///
11 | /// 专门监控域名检测接口api
12 | ///
13 | public class DomainAPI : IHttpHandler
14 | {
15 | protected const string S_PROC_NAME = "sProcName"; //调用方法名
16 | protected const string DOMAIN_KEY = "domainKey"; //微信域名检测key
17 | protected const string DOMAIN_LIST = "domainList"; //落地域名列表
18 | protected const string OVER_TIME = "overTime"; //授权截至时间
19 | protected const string OPENID = "openId"; //用户id
20 | protected const string USER_ID = "userId"; //代理商id
21 | protected const string POST = "POST";
22 |
23 | public void ProcessRequest(HttpContext context)
24 | {
25 | ///获取调用方法名
26 | string sProName = context.Request[S_PROC_NAME];
27 | string result = string.Empty;
28 | Dictionary dic = new Dictionary();
29 | if (context.Request.HttpMethod.ToUpper().Equals(POST))
30 | {
31 | #region 获取post中的参数
32 | ///获取POST参数集合
33 | NameValueCollection nvcForm = context.Request.Form;
34 | ///遍历POST参数集合
35 | foreach (string key in nvcForm.Keys)
36 | {
37 | //将key value 参数加入到Dictionary对象中
38 | dic.Add(key, nvcForm[key]);
39 | }
40 | #endregion
41 |
42 | try
43 | {
44 | #region 判断用户id是否存在操作权限
45 |
46 | string key = dic[DOMAIN_KEY];
47 | string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckId", "CheckKey");
48 |
49 | if (string.IsNullOrEmpty(dic[USER_ID]) || dic[USER_ID] != wxCheckApiKey)
50 | {
51 | //代理商不存在
52 | result = "{\"Code\":\"009\",\"Msg\":\"非法访问,联系管理员!\"}";
53 | JsonpResult(context, result);
54 | return;
55 | }
56 | #endregion
57 |
58 | #region 获取授权key信息
59 |
60 | switch (sProName)
61 | {
62 | case "Update":
63 | if (RedisCacheToolsYUN1.Exists(key))
64 | {
65 | //更新
66 | string domainTemp = RedisCacheToolsYUN1.Get(key);
67 | string keyValue = domainTemp;
68 | string openid = dic[OPENID];
69 | if (!keyValue.Contains(";"))
70 | {
71 |
72 | keyValue = openid + ";" + domainTemp;
73 | }
74 | else
75 | {
76 | string[] temp = keyValue.Split(';');
77 | keyValue = openid + ";" + temp[1];//可以更新openid
78 | }
79 | RedisCacheToolsYUN1.Add(key, keyValue, DateTime.Parse(dic[OVER_TIME]));
80 |
81 | }
82 | result = "{\"Code\":\"101\",\"Msg\":\"续期时间成功!\"}";
83 | break;
84 | case "Delete":
85 | if (RedisCacheToolsYUN1.Exists(key))
86 | {
87 | RedisCacheToolsYUN1.Remove(key);
88 | }
89 | result = "{\"Code\":\"102\",\"Msg\":\"授权key删除成功!\"}";
90 | break;
91 | default:
92 | result = "{\"Code\":\"009\",\"Msg\":\"参数错误,非法访问1!\"}";
93 | break;
94 | }
95 | #endregion
96 | }
97 | catch (Exception e)
98 | {
99 | result = "{\"Code\":\"010\",\"Msg\":\"" + e.Message + "\"}";
100 | }
101 | }
102 | #region 其它请求
103 | else
104 | {
105 | result = "{\"Code\":\"009\",\"Msg\":\"参数错误,非法访问2!\"}";
106 | }
107 |
108 | #endregion
109 |
110 | JsonpResult(context, result);
111 |
112 |
113 | }
114 |
115 | public bool IsReusable
116 | {
117 | get
118 | {
119 | return false;
120 | }
121 | }
122 |
123 | protected void JsonpResult(HttpContext context, string result)
124 | {
125 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
126 | {
127 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
128 |
129 | result = callBack + "(" + result + ")";
130 | }
131 | context.Response.Write(result);
132 |
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/DomainSetByKey.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DomainSetByKey.aspx.cs" Inherits="WeChatTools.API.DomainSetByKey" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
125 | 更新监控域名
126 |
127 |
128 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/DomainSetByKey.aspx.cs:
--------------------------------------------------------------------------------
1 | using WeChatTools.Core;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 | using System.Web.UI;
7 | using System.Web.UI.WebControls;
8 |
9 | namespace WeChatTools.API
10 | {
11 | ///
12 | ///专门监控域名检测接口api
13 | ///
14 | public partial class DomainSetByKey : System.Web.UI.Page
15 | {
16 |
17 |
18 | protected void Page_Load(object sender, EventArgs e)
19 | {
20 | if (!IsPostBack)
21 | {
22 | string key = Request.QueryString["key"];//key 加密的
23 |
24 | string typekey = Request.QueryString["typekey"];//typekey 加密的
25 | if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(typekey))
26 | {
27 | try
28 | {
29 | TextBox1.Text = key;
30 | if (RedisCacheToolsYUN0.Exists("wxcheck:" + key))
31 | {
32 | if (RedisCacheToolsYUN1.Exists(key))
33 | {
34 | string keyValue = RedisCacheToolsYUN1.Get(key);
35 | string[] temp = keyValue.Split(';');
36 |
37 | if (temp.Length == 2 && !string.IsNullOrEmpty(temp[1]))
38 | {
39 |
40 | TextBox2.Text = temp[1];
41 | }
42 | else
43 | {
44 | TextBox2.Text = "";
45 | }
46 | }
47 |
48 | string keyleft = "0天0时0分";
49 | TimeSpan? ts = RedisCacheToolsYUN0.GetKeyTimeToLive("wxcheck:" + key);
50 | keyleft = ts.Value.Days + "天" + ts.Value.Hours + "时" + ts.Value.Minutes + "分";
51 |
52 | /// keyLogs = "/Logs/" + key+".txt";
53 | string domainRed = "没有屏蔽的域名";
54 | if (RedisCacheToolsYUN1.Exists("Red" + key))
55 | {
56 | domainRed = RedisCacheToolsYUN1.Get("Red" + key);
57 | }
58 | Label1.Text = domainRed;
59 | Label2.Text = keyleft;
60 |
61 |
62 | }
63 | string keycount = "keyCount:wxcheck:" + key;
64 | if (typekey == "0" || typekey == "-9")
65 | {
66 | syCount.Style.Add("display", "block");
67 | if (typekey == "0")
68 | {
69 | typeKey.Style.Add("display", "none");
70 | }
71 | if (RedisCacheToolsYUN0.Exists(keycount)) {
72 | string keycountValue = "0";
73 | keycountValue = RedisCacheToolsYUN0.Get(keycount);
74 | Label3.Text = keycountValue;
75 | }
76 |
77 |
78 | }
79 | else
80 | {
81 | typeKey.Style.Add("display", "block");
82 | syCount.Style.Add("display", "none");
83 | }
84 |
85 | }
86 |
87 | catch (Exception ex)
88 | {
89 | base.Response.Write("非法访问了:" + ex.Message);
90 | base.Response.End();
91 | // HttpContext.Current.Response.Write("非法访问了");
92 |
93 | // throw new Exception("非法访问了");
94 | }
95 | }
96 | else
97 | {
98 | typeKey.Style.Add("display", "none");
99 | syCount.Style.Add("display", "none");
100 | }
101 | }
102 | }
103 |
104 | protected void Button1_Click(object sender, EventArgs e)
105 | {
106 | string key = this.TextBox1.Text;
107 | string domainTemp = this.TextBox2.Text.Trim();
108 | domainTemp = domainTemp.Replace(",", ",").Replace(" ", "");
109 | if (domainTemp.Length > 1 && domainTemp.Length < 200)
110 | {
111 | if (RedisCacheToolsYUN1.Exists(key))
112 | {
113 | TimeSpan? ts = RedisCacheToolsYUN1.GetKeyTimeToLive(key);
114 | string keyValue = RedisCacheToolsYUN1.Get(key);
115 | string[] temp = keyValue.Split(';');
116 | string nKeyValue = temp[0] + ";" + domainTemp;
117 |
118 | RedisCacheToolsYUN1.Add(key, nKeyValue, TimeSpan.Parse(ts.ToString()));
119 | ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "msg", "alert('更新监控域名成功');window.returnValue = 'true';", true);
120 | }
121 | else
122 | {
123 | if (RedisCacheToolsYUN0.Exists("wxcheck:" + key))
124 | {
125 |
126 | string keyValue = RedisCacheToolsYUN0.Get("wxcheck:" + key);
127 | TimeSpan? ts = RedisCacheToolsYUN0.GetKeyTimeToLive("wxcheck:" + key);
128 | string[] temp = keyValue.Split(';');
129 |
130 | if (temp[1] != "0")
131 | {//-9 1 2 20
132 | string nKeyValue = temp[0] + ";" + domainTemp;
133 |
134 | RedisCacheToolsYUN1.Add(key, nKeyValue, TimeSpan.Parse(ts.ToString()));
135 | ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "msg", "alert('更新监控域名成功');window.returnValue = 'true';", true);
136 | }
137 | else
138 | {// 0
139 | ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "msg", "alert('更新监控域名失败,流量包key不支持!');window.returnValue = 'true';", true);
140 | }
141 | }
142 | else
143 | {
144 | if (RedisCacheToolsYUN1.Exists(key))
145 | {
146 | RedisCacheToolsYUN1.Remove(key);
147 | }
148 | ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "msg", "alert('更新监控域名失败,key没有开通');window.returnValue = 'true';", true);
149 | }
150 | }
151 | }
152 | else
153 | {
154 | if (RedisCacheToolsYUN1.Exists(key))
155 | {
156 | RedisCacheToolsYUN1.Remove(key);
157 | }
158 | ScriptManager.RegisterStartupScript((Page)this, base.GetType(), "msg", "alert('更新监控域名失败,字符长度不能超过200');window.returnValue = 'true';", true);
159 |
160 | }
161 | }
162 |
163 |
164 |
165 | }
166 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/DomainSetByKey.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace WeChatTools.API {
11 |
12 |
13 | public partial class DomainSetByKey {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 |
24 | ///
25 | /// TextBox1 控件。
26 | ///
27 | ///
28 | /// 自动生成的字段。
29 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
30 | ///
31 | protected global::System.Web.UI.WebControls.TextBox TextBox1;
32 |
33 | ///
34 | /// Label2 控件。
35 | ///
36 | ///
37 | /// 自动生成的字段。
38 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
39 | ///
40 | protected global::System.Web.UI.WebControls.Label Label2;
41 |
42 | ///
43 | /// typeKey 控件。
44 | ///
45 | ///
46 | /// 自动生成的字段。
47 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
48 | ///
49 | protected global::System.Web.UI.HtmlControls.HtmlGenericControl typeKey;
50 |
51 | ///
52 | /// TextBox2 控件。
53 | ///
54 | ///
55 | /// 自动生成的字段。
56 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
57 | ///
58 | protected global::System.Web.UI.WebControls.TextBox TextBox2;
59 |
60 | ///
61 | /// Button1 控件。
62 | ///
63 | ///
64 | /// 自动生成的字段。
65 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
66 | ///
67 | protected global::System.Web.UI.WebControls.Button Button1;
68 |
69 | ///
70 | /// Label1 控件。
71 | ///
72 | ///
73 | /// 自动生成的字段。
74 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
75 | ///
76 | protected global::System.Web.UI.WebControls.Label Label1;
77 |
78 | ///
79 | /// syCount 控件。
80 | ///
81 | ///
82 | /// 自动生成的字段。
83 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
84 | ///
85 | protected global::System.Web.UI.HtmlControls.HtmlGenericControl syCount;
86 |
87 | ///
88 | /// Label3 控件。
89 | ///
90 | ///
91 | /// 自动生成的字段。
92 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
93 | ///
94 | protected global::System.Web.UI.WebControls.Label Label3;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/api/jsonpHandler.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="jsonpHandler.ashx.cs" Class="WeChatTools.API.jsonpHandler" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/hdShowImg.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="hdShowImg.ashx.cs" Class="WeChatTools.API.hdShowImg" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/hdShowImg.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using WeChatTools.Core;
6 |
7 | namespace WeChatTools.API
8 | {
9 | ///
10 | /// 微信公众号文章图片中转,突破微信反盗链限制
11 | ///
12 | public class hdShowImg : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | //防止盗链,增加自己服务器压力
18 | if (context.Request.UrlReferrer != null)
19 | {
20 | string refurl = context.Request.UrlReferrer.Host.ToString();
21 | string refhost = ConfigTool.ReadVerifyConfig("wxShowImg", "Other");
22 | if (refurl.Equals(refhost))
23 | {
24 | getMp3(context);
25 | }
26 | else
27 | {
28 | context.Response.ContentType = "text/plain";
29 | context.Response.Write("非法访问!");
30 |
31 | }
32 | }
33 | else
34 | {
35 | getMp3(context);
36 | }
37 | context.Response.End();
38 | }
39 |
40 | private void getImg(HttpContext context)
41 | {
42 | HttpHelper helper = new HttpHelper();
43 | HttpItem item = new HttpItem()
44 | {
45 |
46 | URL = context.Request["url"].ToString(),
47 | Referer = "",//必填参数,这里置空
48 |
49 | UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176 MicroMessenger/4.3.2",//useragent可有可无
50 | ResultType = ResultType.Byte
51 |
52 | };
53 |
54 | HttpResult res = helper.GetHtml(item);
55 |
56 | string code = "data:image/webp;base64," + Convert.ToBase64String(res.ResultByte);
57 | context.Response.ContentType = "image/webp";
58 | context.Response.OutputStream.Write(res.ResultByte, 0, res.ResultByte.Length);
59 | }
60 |
61 |
62 | private void getMp3(HttpContext context)
63 | {
64 | string Speed = context.Request["speed"].ToString();
65 | string SpeakValueEn = context.Request["s"].ToString();
66 |
67 | SpeakValueEn = HttpUtility.UrlEncode(SpeakValueEn);
68 | string baiduMp3 = "https://tts.baidu.com/text2audio?cuid=baike&lan=ZH&ctp=1&pdt=301&vol=9&rate=32&ie=UTF-8&per=0&spd=" + Speed + "&tex=" + SpeakValueEn;
69 | HttpHelper helper = new HttpHelper();
70 | HttpItem item = new HttpItem()
71 | {
72 |
73 | URL = baiduMp3,
74 | Referer = "",//必填参数,这里置空
75 | SecurityProtocolType = System.Net.SecurityProtocolType.Tls12,
76 | UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176 MicroMessenger/4.3.2",//useragent可有可无
77 | ResultType = ResultType.Byte
78 |
79 | };
80 |
81 | HttpResult res = helper.GetHtml(item);
82 |
83 | string code = "data:audio/mp3;base64," + Convert.ToBase64String(res.ResultByte);
84 | context.Response.ContentType = "audio/mp3";
85 | context.Response.OutputStream.Write(res.ResultByte, 0, res.ResultByte.Length);
86 | }
87 |
88 | public bool IsReusable
89 | {
90 | get
91 | {
92 | return false;
93 | }
94 | }
95 | }
96 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/qzoneH5.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="qzoneH5.ashx.cs" Class="WeChatTools.API.pro.qzoneH5" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/qzoneH5.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using WeChatTools.Core;
6 |
7 | namespace WeChatTools.API.pro
8 | {
9 | ///
10 | /// qzoneH5 的摘要说明
11 | ///
12 | public class qzoneH5 : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 |
18 | getImg(context);
19 |
20 |
21 | }
22 |
23 | private void getImg(HttpContext context)
24 | {
25 | HttpHelper helper = new HttpHelper();
26 |
27 | string hosturl = ConfigTool.ReadVerifyConfig("qqzoneImg", "Other");//这些域名都需要指向用户最终要访问的站点
28 | string[] sArray = hosturl.Split(',');
29 | Random ran = new Random();
30 | int RandKey1 = ran.Next(0, sArray.Length);//随机选中action
31 | string imgName = sArray[RandKey1];
32 |
33 | string url = context.Request.Url.Scheme + "://" + context.Request.Url.Authority + "/wechat/" + imgName;
34 |
35 | HttpItem item = new HttpItem()
36 | {
37 |
38 | URL = url,
39 | Referer = "",//必填参数,这里置空
40 |
41 | UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176 MicroMessenger/4.3.2",//useragent可有可无
42 | ResultType = ResultType.Byte
43 |
44 | };
45 |
46 | HttpResult res = helper.GetHtml(item);
47 |
48 | string code = "data:image/webp;base64," + Convert.ToBase64String(res.ResultByte);
49 | context.Response.ContentType = "image/webp";
50 | context.Response.OutputStream.Write(res.ResultByte, 0, res.ResultByte.Length);
51 | }
52 |
53 |
54 | public bool IsReusable
55 | {
56 | get
57 | {
58 | return false;
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/shorturl.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="shorturl.ashx.cs" Class="WeChatTools.API.dev.shorturl" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/dev/shorturl.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Net;
7 | using System.Text;
8 | using System.Text.RegularExpressions;
9 | using System.Web;
10 | using WeChatTools.Core;
11 |
12 | namespace WeChatTools.API.dev
13 | {
14 | ///
15 | /// 短链接生成接口--正式使用接口
16 | ///
17 | public class shorturl : IHttpHandler
18 | {
19 | private const int DURATION = 24 * 60;
20 |
21 | protected const string GET = "GET";
22 | public void ProcessRequest(HttpContext context)
23 | {
24 | string result = string.Empty;
25 | string url = context.Request["url"];
26 | if (!string.IsNullOrEmpty(url))
27 | {
28 |
29 | result = GetICPInfo(url);
30 | context.Response.ContentType = "text/plain";
31 |
32 | }
33 | else
34 | {
35 | result = "未查询到备案信息!!!!!";
36 | }
37 | context.Response.Write(result);
38 | context.Response.End();
39 |
40 |
41 | }
42 |
43 | public bool IsReusable
44 | {
45 | get
46 | {
47 | return false;
48 | }
49 | }
50 | ///
51 | /// https://beian.miit.gov.cn 采用官网备案查询
52 | ///
53 | ///
54 | ///
55 | public static string GetICPInfo(string URL)
56 | {
57 | string getString = "";
58 | if (!IsDomain(URL)) { return getString; }
59 |
60 |
61 | HttpWebRequest httpWebRequest = null;
62 | HttpWebResponse webResponse = null;
63 | try
64 | {
65 | string domain = "http://127.0.0.1:8039/queryByCondition?domain=" + URL;
66 | httpWebRequest = (HttpWebRequest)WebRequest.Create(domain);
67 | httpWebRequest.Host = "127.0.0.1";
68 | httpWebRequest.Accept = "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01";
69 | httpWebRequest.KeepAlive = true;
70 |
71 | httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36";
72 | httpWebRequest.Method = "GET";
73 | httpWebRequest.Timeout = 3000;//建立连接时间
74 | httpWebRequest.ReadWriteTimeout = 1000;//下载数据时间
75 |
76 | webResponse = httpWebRequest.GetResponse() as HttpWebResponse;
77 | getString = Resp2String(webResponse, false);
78 |
79 |
80 | }
81 | catch (Exception ex)
82 | {
83 | getString = "";
84 | //LogTools.WriteLine("执行GetHtml发生错误:" + ex.Message);
85 | // return getString;
86 | }
87 | finally
88 | {
89 | if (webResponse != null)
90 | {
91 | webResponse.Close();
92 | webResponse = null;
93 | }
94 | if (httpWebRequest != null)
95 | {
96 | httpWebRequest.Abort();
97 | httpWebRequest = null;
98 | }
99 | }
100 |
101 |
102 | return getString;
103 | }
104 |
105 | ///
106 | /// 判断一个字符串,是否匹配指定的表达式(区分大小写的情况下)
107 | ///
108 | /// 正则表达式
109 | /// 要匹配的字符串
110 | ///
111 | public static bool IsMatch(string expression, string str)
112 | {
113 | Regex reg = new Regex(expression);
114 | if (string.IsNullOrEmpty(str))
115 | return false;
116 | return reg.IsMatch(str);
117 |
118 | }
119 |
120 | ///
121 | /// 验证字符串是否是域名
122 | ///
123 | /// 指定字符串
124 | ///
125 | public static bool IsDomain(string str)
126 | {
127 | if (str.ToLower().Equals("gov.cn") || str.ToLower().Equals("org.cn"))
128 | {
129 | return false;
130 | }
131 | else
132 | {
133 | string pattern = @"^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$";
134 | return IsMatch(pattern, str);
135 | }
136 | }
137 |
138 | private static string Resp2String(HttpWebResponse HttpWebResponse, bool isZip)
139 | {
140 | Stream responseStream = null;
141 | StreamReader sReader = null;
142 | String value = null;
143 |
144 | try
145 | {
146 | if (!isZip)
147 | {
148 | responseStream = HttpWebResponse.GetResponseStream();
149 | }
150 | else
151 | {
152 | //需要Zip解压
153 | responseStream = new GZipStream(HttpWebResponse.GetResponseStream(), CompressionMode.Decompress);
154 | }
155 |
156 |
157 | sReader = new StreamReader(responseStream, Encoding.GetEncoding("UTF-8"));
158 | value = sReader.ReadToEnd();
159 | }
160 | catch (Exception ex)
161 | {
162 |
163 | throw ex;
164 | }
165 | finally
166 | {
167 | if (sReader != null)
168 | sReader.Close();
169 |
170 | if (responseStream != null)
171 | responseStream.Close();
172 |
173 | if (HttpWebResponse != null)
174 | HttpWebResponse.Close();
175 | }
176 |
177 | return value;
178 | }
179 |
180 | }
181 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/dyUrlCheck.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="dyUrlCheck.ashx.cs" Class="WeChatTools.API.pro.DYUrlCheck" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/dyUrlCheck.ashx.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Web;
4 | using WeChatTools.Core;
5 |
6 | namespace WeChatTools.API.pro
7 | {
8 | ///
9 | /// 微信域名检测接口--免费的
10 | ///
11 | public class DYUrlCheck : IHttpHandler
12 | {
13 | private const int DURATION = 24 * 60;
14 | private static string userIP = "127.0.0.1";
15 | protected const string GET = "GET";
16 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey", "CheckKey");
17 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
18 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
19 | public void ProcessRequest(HttpContext context)
20 | {
21 | string result = string.Empty;
22 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
23 | {
24 | userIP = LogTools.GetWebClientIp(context);
25 | context.Response.ContentType = "text/plain";
26 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
27 |
28 | string urlCheck = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
29 |
30 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM))
31 | {
32 |
33 | if (!string.IsNullOrEmpty(context.Request["url"]))
34 | {
35 | //需要检测的网址
36 | urlCheck = context.Request["url"]; //检测的值
37 |
38 | if (!urlCheck.ToLower().Contains(".kuaizhan.com") && !urlCheck.ToLower().Contains(".luckhl8.com") && !urlCheck.ToLower().Contains(".kennethhwong.cn") && !urlCheck.ToLower().Contains(".hatai678.top") && !urlCheck.ToLower().Contains(".jszkgs.top"))
39 | {
40 | ServiceApiClient SpVoiceObj2 = null;
41 | // ServiceApiClient SpVoiceObj = null;
42 | try
43 | {
44 |
45 | bool isTrue = urlCheck.StartsWith("http");
46 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
47 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
48 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
49 | {
50 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
51 | }
52 |
53 | string json2 = "{\"Mode\":\"AuthDouYinKey\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxCheckApiKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
54 |
55 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
56 | SpVoiceObj2.Open();
57 | result = SpVoiceObj2.Api(json2);
58 | SpVoiceObj2.Close();
59 |
60 |
61 | }
62 | catch (System.ServiceModel.CommunicationException)
63 | {
64 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
65 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
66 | }
67 | catch (TimeoutException)
68 | {
69 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
70 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
71 | }
72 | catch (Exception ex)
73 | {
74 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
75 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
76 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
77 | LogTools.WriteLine(userIP + ":" + ex.Message);
78 | }
79 | }
80 | else
81 | {
82 | result = "{\"State\":false,\"Code\":\"002\",\"Data\":\"" + urlCheck + " \",\"Msg\":\"歇一歇,访问太快了,联系管理员!\"}";
83 | }
84 |
85 |
86 | }
87 | else
88 | {
89 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
90 |
91 | }
92 | }
93 | else
94 | {
95 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
96 | }
97 |
98 | }
99 |
100 | context.Response.Write(result);
101 | context.Response.End();
102 | }
103 |
104 | public bool IsReusable
105 | {
106 | get
107 | {
108 | return false;
109 | }
110 | }
111 |
112 |
113 | }
114 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/dyUrlCheck2.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="dyUrlCheck2.ashx.cs" Class="WeChatTools.API.pro.DYUrlCheck2" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/dyUrlCheck2.ashx.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Web;
4 | using WeChatTools.Core;
5 |
6 | namespace WeChatTools.API.pro
7 | {
8 | ///
9 | /// 微信域名检测接口 --正式使用接口
10 | ///
11 | public class DYUrlCheck2 : IHttpHandler
12 | {
13 | private const int DURATION = 24 * 60;
14 | private static string userIP = "127.0.0.1";
15 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
16 | protected const string GET = "GET";
17 | public void ProcessRequest(HttpContext context)
18 | {
19 | string result = string.Empty;
20 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
21 | {
22 |
23 | string urlCheck = string.Empty;
24 | context.Response.ContentType = "text/plain";
25 | context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
26 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
27 | context.Response.Headers.Add("Access-Control-Allow-Methods", "GET");
28 | if (!string.IsNullOrEmpty(context.Request["url"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
29 | {
30 | string userKey = context.Request["key"]; //key ,md5值
31 |
32 | if (userKey.Trim() == wxCheckApiKey)
33 | {
34 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
35 | }
36 | else
37 | {
38 |
39 |
40 |
41 | ServiceApiClient SpVoiceObj2 = null;
42 | // ServiceApiClient SpVoiceObj = null;
43 | try
44 | {
45 | //需要检测的网址
46 | urlCheck = context.Request["url"]; //检测的值
47 | bool isTrue = urlCheck.StartsWith("http");
48 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
49 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
50 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
51 | {
52 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
53 | }
54 |
55 | string json2 = "{\"Mode\":\"AuthDouYinKey\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
56 |
57 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
58 | SpVoiceObj2.Open();
59 | result = SpVoiceObj2.Api(json2);
60 | SpVoiceObj2.Close();
61 |
62 |
63 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
64 | {
65 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
66 | result = callBack + "(" + result + ")";
67 | }
68 | }
69 | catch (System.ServiceModel.CommunicationException)
70 | {
71 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
72 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
73 | }
74 | catch (TimeoutException)
75 | {
76 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
77 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
78 | }
79 | catch (Exception ex)
80 | {
81 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
82 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
83 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
84 | //正式用
85 | userIP = LogTools.GetWebClientIp(context);
86 | LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
87 | }
88 |
89 |
90 | }
91 | }
92 | else
93 | {
94 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
95 |
96 | }
97 | }
98 | else
99 | {
100 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
101 | }
102 | context.Response.Write(result);
103 | context.Response.End();
104 |
105 |
106 | }
107 |
108 | public bool IsReusable
109 | {
110 | get
111 | {
112 | return false;
113 | }
114 | }
115 |
116 |
117 | }
118 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/icpCheck.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="icpCheck.ashx.cs" Class="WeChatTools.API.pro.icpCheck" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/icpCheck.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// qq域名检测 - 免费的
9 | ///
10 | public class icpCheck : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | protected const string GET = "GET";
15 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey", "CheckKey");
16 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
17 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
18 | public void ProcessRequest(HttpContext context)
19 | {
20 | string result = string.Empty;
21 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
22 | {
23 | userIP = LogTools.GetWebClientIp(context);
24 | context.Response.ContentType = "text/plain";
25 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
26 |
27 | string urlCheck = string.Empty;
28 | string callBack = string.Empty;
29 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM))
30 | {
31 | if (!string.IsNullOrEmpty(context.Request["url"]))
32 | {
33 | //需要检测的网址
34 | urlCheck = context.Request["url"]; //检测的值
35 | ServiceApiClient SpVoiceObj2 = null;
36 |
37 | try
38 | {
39 |
40 | if (LogTools.IsDomain(urlCheck))
41 | {
42 |
43 | string apiMode = context.Request["mode"]; //检测的值
44 | if (string.IsNullOrEmpty(apiMode))
45 | {
46 | apiMode = "authicpkey";
47 | }
48 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxCheckApiKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
49 |
50 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
51 | SpVoiceObj2.Open();
52 | result = SpVoiceObj2.Api(json2);
53 | SpVoiceObj2.Close();
54 | }
55 | else
56 | {
57 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
58 | }
59 | }
60 | catch (System.ServiceModel.CommunicationException)
61 | {
62 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
63 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
64 | }
65 | catch (TimeoutException)
66 | {
67 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
68 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
69 | }
70 | catch (Exception ex)
71 | {
72 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
73 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
74 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
75 | LogTools.WriteLine(userIP + ":" + wxCheckApiKey + ":" + ex.Message);
76 | }
77 |
78 |
79 |
80 | }
81 | else
82 | {
83 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
84 |
85 | }
86 | }
87 | else
88 | {
89 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
90 | }
91 |
92 | }
93 | else
94 | {
95 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
96 | }
97 | context.Response.Write(result);
98 | context.Response.End();
99 | }
100 |
101 | public bool IsReusable
102 | {
103 | get
104 | {
105 | return false;
106 | }
107 | }
108 |
109 |
110 | }
111 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/icpCheck2.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="icpCheck2.ashx.cs" Class="WeChatTools.API.pro.icpCheck2" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/icpCheck2.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 微信域名检测接口 --正式使用接口
9 | ///
10 | public class icpCheck2 : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
15 | protected const string GET = "GET";
16 | public void ProcessRequest(HttpContext context)
17 | {
18 | string result = string.Empty;
19 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
20 | {
21 |
22 | string urlCheck = string.Empty;
23 | context.Response.ContentType = "text/plain";
24 |
25 | if (!string.IsNullOrEmpty(context.Request["url"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
26 | {
27 | string userKey = context.Request["key"]; //key ,md5值
28 |
29 | if (userKey.Trim() == wxCheckApiKey)
30 | {
31 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
32 | }
33 | else
34 | {
35 |
36 |
37 | ServiceApiClient SpVoiceObj2 = null;
38 | // ServiceApiClient SpVoiceObj = null;
39 | try
40 | {
41 | //需要检测的网址
42 | urlCheck = context.Request["url"]; //检测的值
43 | string apiMode = context.Request["mode"]; //检测的值
44 | if (string.IsNullOrEmpty(apiMode))
45 | {
46 | apiMode = "authicpkey";
47 | }
48 | if (LogTools.IsDomain(urlCheck))
49 | {
50 |
51 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
52 |
53 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
54 | SpVoiceObj2.Open();
55 | result = SpVoiceObj2.Api(json2);
56 | SpVoiceObj2.Close();
57 | }
58 | else
59 | {
60 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
61 | }
62 |
63 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
64 | {
65 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
66 | result = callBack + "(" + result + ")";
67 | }
68 | }
69 | catch (System.ServiceModel.CommunicationException)
70 | {
71 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
72 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
73 | }
74 | catch (TimeoutException)
75 | {
76 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
77 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
78 | }
79 | catch (Exception ex)
80 | {
81 |
82 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
83 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
84 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
85 | //正式用
86 | userIP = LogTools.GetWebClientIp(context);
87 | LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
88 | }
89 |
90 |
91 | }
92 | }
93 | else
94 | {
95 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
96 |
97 | }
98 | }
99 | else
100 | {
101 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
102 | }
103 | context.Response.Write(result);
104 | context.Response.End();
105 |
106 |
107 | }
108 |
109 | public bool IsReusable
110 | {
111 | get
112 | {
113 | return false;
114 | }
115 | }
116 |
117 |
118 | }
119 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/qqUrlCheck.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="qqUrlCheck.ashx.cs" Class="WeChatTools.API.pro.qqUrlCheck" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/qqUrlCheck.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// qq域名检测 - 免费的
9 | ///
10 | public class qqUrlCheck : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | protected const string GET = "GET";
15 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey", "CheckKey");
16 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
17 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
18 | public void ProcessRequest(HttpContext context)
19 | {
20 | string result = string.Empty;
21 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
22 | {
23 |
24 | userIP = LogTools.GetWebClientIp(context);
25 | context.Response.ContentType = "text/plain";
26 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
27 |
28 | string urlCheck = string.Empty;
29 |
30 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM))
31 | {
32 |
33 |
34 | if (!string.IsNullOrEmpty(context.Request["url"]))
35 | {
36 | //需要检测的网址
37 | urlCheck = context.Request["url"]; //检测的值
38 |
39 |
40 |
41 | ServiceApiClient SpVoiceObj2 = null;
42 | // ServiceApiClient SpVoiceObj = null;
43 | try
44 | {
45 |
46 | bool isTrue = urlCheck.StartsWith("http");
47 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
48 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
49 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
50 | {
51 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
52 | }
53 | string apiMode = context.Request["mode"]; //检测的值
54 | if (string.IsNullOrEmpty(apiMode))
55 | {
56 | apiMode = "AuthQQKey";
57 | }
58 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxCheckApiKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
59 |
60 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
61 | SpVoiceObj2.Open();
62 | result = SpVoiceObj2.Api(json2);
63 | SpVoiceObj2.Close();
64 |
65 |
66 | }
67 | catch (System.ServiceModel.CommunicationException)
68 | {
69 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
70 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
71 | }
72 | catch (TimeoutException)
73 | {
74 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
75 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
76 | }
77 | catch (Exception ex)
78 | {
79 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
80 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
81 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
82 | LogTools.WriteLine(userIP + ":" + wxCheckApiKey + ":" + ex.Message);
83 | }
84 |
85 |
86 |
87 | }
88 | else
89 | {
90 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
91 |
92 | }
93 | }
94 | else
95 | {
96 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
97 | }
98 |
99 | }
100 | else
101 | {
102 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
103 | }
104 | context.Response.Write(result);
105 | context.Response.End();
106 | }
107 |
108 | public bool IsReusable
109 | {
110 | get
111 | {
112 | return false;
113 | }
114 | }
115 |
116 |
117 | }
118 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/qqUrlCheck2.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="qqUrlCheck2.ashx.cs" Class="WeChatTools.API.pro.qqUrlCheck2" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/qqUrlCheck2.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// qq域名检测
9 | ///
10 | public class qqUrlCheck2 : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
15 | protected const string GET = "GET";
16 | public void ProcessRequest(HttpContext context)
17 | {
18 | string result = string.Empty;
19 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
20 | {
21 |
22 | string urlCheck = string.Empty;
23 | context.Response.ContentType = "text/plain";
24 | context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
25 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
26 | context.Response.Headers.Add("Access-Control-Allow-Methods", "GET");
27 | if (!string.IsNullOrEmpty(context.Request["url"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
28 | {
29 | string userKey = context.Request["key"]; //key ,md5值
30 |
31 | if (userKey.Trim() == wxCheckApiKey)
32 | {
33 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
34 | }
35 | else
36 | {
37 |
38 | ServiceApiClient SpVoiceObj2 = null;
39 | // ServiceApiClient SpVoiceObj = null;
40 | try
41 | {
42 | //需要检测的网址
43 | urlCheck = context.Request["url"]; //检测的值
44 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
45 | bool isTrue = urlCheck.StartsWith("http");
46 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
47 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
48 | {
49 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
50 | }
51 |
52 | string apiMode = context.Request["mode"]; //检测的值
53 | if (string.IsNullOrEmpty(apiMode))
54 | {
55 | apiMode = "AuthQQKey";
56 | }
57 |
58 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
59 |
60 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
61 | SpVoiceObj2.Open();
62 | result = SpVoiceObj2.Api(json2);
63 | SpVoiceObj2.Close();
64 | ////JsonObject.Results aup = JsonConvert.DeserializeObject(result);
65 |
66 | ////if (aup.State == true)
67 | ////{
68 | //// string json = "{\"Mode\":\"WXCheckUrl\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
69 | //// SpVoiceObj = new ServiceApiClient("NetTcpBinding_IServiceApi");
70 | //// SpVoiceObj.Open();
71 | //// result = SpVoiceObj.Api(json);
72 | //// SpVoiceObj.Close();
73 |
74 | ////}
75 |
76 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
77 | {
78 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
79 | result = callBack + "(" + result + ")";
80 | }
81 | }
82 | catch (System.ServiceModel.CommunicationException)
83 | {
84 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
85 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
86 | }
87 | catch (TimeoutException)
88 | {
89 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
90 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
91 | }
92 | catch (Exception ex)
93 | {
94 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
95 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
96 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
97 | //正式用
98 | userIP = LogTools.GetWebClientIp(context);
99 | LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
100 | }
101 |
102 |
103 | }
104 | }
105 | else
106 | {
107 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
108 |
109 | }
110 | }
111 | else
112 | {
113 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
114 | }
115 | context.Response.Write(result);
116 | context.Response.End();
117 | }
118 |
119 | public bool IsReusable
120 | {
121 | get
122 | {
123 | return false;
124 | }
125 | }
126 |
127 |
128 |
129 | }
130 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/shorturl.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="shorturl.ashx.cs" Class="WeChatTools.API.pro.shorturl" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/shorturl.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 短链接生成接口--正式使用接口
9 | ///
10 | public class shorturl : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 |
14 | protected const string GET = "GET";
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | string result = string.Empty;
18 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
19 | {
20 | string url = context.Request["url"];
21 | string key = context.Request["key"]; //key ,md5值
22 | string type = context.Request["type"]; //key ,md5值
23 | context.Response.ContentType = "text/plain";
24 |
25 | if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(key) && key.Length == 32)
26 | {
27 |
28 | ServiceApiClient SpVoiceObj = null;
29 | try
30 | {
31 | if (type.ToUpper() != "DWZCN") {
32 | if (url.StartsWith("http://") || url.StartsWith("https://"))
33 | {
34 | url = System.Web.HttpUtility.UrlEncode(url);
35 | }
36 | }
37 |
38 | string json2 = "{\"Mode\":\"ShortUrl\",\"Param\":\"{\'CheckUrl\':\'" + url + "\',\'type\':\'" + type + "\',\'UserKey\':\'" + key + "\'}\"}";
39 |
40 | SpVoiceObj = new ServiceApiClient("NetTcpBinding_IServiceApi");
41 | SpVoiceObj.Open();
42 | result = SpVoiceObj.Api(json2);
43 | SpVoiceObj.Close();
44 |
45 |
46 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
47 | {
48 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
49 | result = callBack + "(" + result + ")";
50 | }
51 | }
52 | catch (System.ServiceModel.CommunicationException)
53 | {
54 | if (SpVoiceObj != null) SpVoiceObj.Abort();
55 | }
56 | catch (TimeoutException)
57 | {
58 | if (SpVoiceObj != null) SpVoiceObj.Abort();
59 | }
60 | catch (Exception ex)
61 | {
62 | if (SpVoiceObj != null) SpVoiceObj.Abort();
63 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + url + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
64 | LogTools.WriteLine( key + ":" + ex.Message);
65 | }
66 |
67 |
68 |
69 | }
70 | else
71 | {
72 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + url + "\",\"Msg\":\"参数错误,联系管理员!\"}";
73 |
74 | }
75 | }
76 | else
77 | {
78 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
79 | }
80 | context.Response.Write(result);
81 | context.Response.End();
82 |
83 |
84 | }
85 |
86 | public bool IsReusable
87 | {
88 | get
89 | {
90 | return false;
91 | }
92 | }
93 |
94 | }
95 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/shorturl3.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="shorturl3.ashx.cs" Class="WeChatTools.API.pro.shorturl3" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/shorturl3.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 短链接生成接口--测试接口
9 | ///
10 | public class shorturl3 : IHttpHandler
11 | {
12 |
13 | private static string userIP = "127.0.0.1";
14 | protected const string POST = "POST";
15 | private string shorturlkey = ConfigTool.ReadVerifyConfig("shorturlKey", "CheckKey");
16 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
17 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
18 |
19 | public void ProcessRequest(HttpContext context)
20 | {
21 | string result = string.Empty;
22 | if (context.Request.HttpMethod.ToUpper().Equals(POST))
23 | {
24 | string url = context.Request["url"];
25 | string type = context.Request["type"]; //key ,md5值
26 | string model = context.Request["model"]; //a,还原;b.生成
27 | context.Response.ContentType = "text/plain";
28 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
29 |
30 | if (!string.IsNullOrEmpty(model) && model.Equals("b"))
31 | { //生成短链接
32 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM) && !string.IsNullOrEmpty(url))
33 | {
34 | userIP = LogTools.GetWebClientIp(context);
35 |
36 | ServiceApiClient SpVoiceObj = null;
37 | try
38 | {
39 |
40 | if (type.ToUpper() != "URLCN" && type.ToUpper() != "WURLCN" && type.ToUpper() != "TCN")
41 | {
42 | type = "URLCN";
43 | }
44 | if (url.StartsWith("http://") || url.StartsWith("https://"))
45 | {
46 | url = System.Web.HttpUtility.UrlEncode(url);
47 | }
48 |
49 | string json2 = "{\"Mode\":\"ShortUrl\",\"Param\":\"{\'CheckUrl\':\'" + url + "\',\'type\':\'" + type + "\',\'UserKey\':\'" + shorturlkey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
50 |
51 | SpVoiceObj = new ServiceApiClient("NetTcpBinding_IServiceApi");
52 | SpVoiceObj.Open();
53 | result = SpVoiceObj.Api(json2);
54 | SpVoiceObj.Close();
55 |
56 |
57 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
58 | {
59 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
60 | result = callBack + "(" + result + ")";
61 | }
62 | }
63 | catch (System.ServiceModel.CommunicationException)
64 | {
65 | if (SpVoiceObj != null) SpVoiceObj.Abort();
66 | }
67 | catch (TimeoutException)
68 | {
69 | if (SpVoiceObj != null) SpVoiceObj.Abort();
70 | }
71 | catch (Exception ex)
72 | {
73 | if (SpVoiceObj != null) SpVoiceObj.Abort();
74 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"https://url.cn/5mfnDv7\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
75 | LogTools.WriteLine(shorturlkey + ":" + ex.Message);
76 | }
77 |
78 |
79 |
80 | }
81 | else
82 | {
83 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"https://url.cn/5mfnDv7\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
84 |
85 | }
86 | }
87 | else
88 | { //短链接还原
89 | result = HttpHelper.GetLocation(url);
90 | }
91 |
92 |
93 | }
94 | else
95 | {
96 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"https://url.cn/5mfnDv7\",\"Msg\":\"参数错误,联系管理员!\"}";
97 | }
98 | context.Response.Headers.Add("Access-Control-Allow-Origin", "https://www.rrbay.com");
99 | context.Response.Headers.Add("Access-Control-Allow-Methods", "POST");
100 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
101 |
102 | context.Response.Write(result);
103 | context.Response.End();
104 |
105 |
106 | }
107 |
108 | public bool IsReusable
109 | {
110 | get
111 | {
112 | return false;
113 | }
114 | }
115 |
116 |
117 |
118 | }
119 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxMiNiProCheck.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="wxMiNiProCheck.ashx.cs" Class="WeChatTools.API.pro.WXMiNiProCheck" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxMiNiProCheck.ashx.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Web;
4 | using WeChatTools.Core;
5 |
6 | namespace WeChatTools.API.pro
7 | {
8 | ///
9 | /// 微信小程序状态检测接口--免费的
10 | ///
11 | public class WXMiNiProCheck : IHttpHandler
12 | {
13 | private const int DURATION = 24 * 60;
14 | private static string userIP = "127.0.0.1";
15 | protected const string GET = "GET";
16 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey", "CheckKey");
17 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
18 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
19 | public void ProcessRequest(HttpContext context)
20 | {
21 | string result = string.Empty;
22 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
23 | {
24 | userIP = LogTools.GetWebClientIp(context);
25 | context.Response.ContentType = "text/plain";
26 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
27 |
28 | string urlCheck = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
29 |
30 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM))
31 | {
32 |
33 | if (!string.IsNullOrEmpty(context.Request["appid"]))
34 | {
35 | //需要检测的网址
36 | urlCheck = context.Request["appid"]; //检测的值
37 |
38 |
39 | ServiceApiClient SpVoiceObj2 = null;
40 | // ServiceApiClient SpVoiceObj = null;
41 | try
42 | {
43 |
44 | if (urlCheck.StartsWith("wx") && urlCheck.Length == 18)
45 | {
46 | string json2 = "{\"Mode\":\"AuthWXMiniProKey\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxCheckApiKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
47 |
48 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
49 | SpVoiceObj2.Open();
50 | result = SpVoiceObj2.Api(json2);
51 | SpVoiceObj2.Close();
52 | }
53 |
54 |
55 | }
56 | catch (System.ServiceModel.CommunicationException)
57 | {
58 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
59 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
60 | }
61 | catch (TimeoutException)
62 | {
63 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
64 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
65 | }
66 | catch (Exception ex)
67 | {
68 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
69 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
70 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
71 | LogTools.WriteLine(userIP + ":" + ex.Message);
72 | }
73 |
74 |
75 |
76 | }
77 | else
78 | {
79 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
80 |
81 | }
82 | }
83 | else
84 | {
85 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
86 | }
87 |
88 | }
89 |
90 | context.Response.Write(result);
91 | context.Response.End();
92 | }
93 |
94 | public bool IsReusable
95 | {
96 | get
97 | {
98 | return false;
99 | }
100 | }
101 |
102 |
103 | }
104 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxMiNiProCheck2.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="wxMiNiProCheck2.ashx.cs" Class="WeChatTools.API.pro.WXMiNiProCheck2" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxMiNiProCheck2.ashx.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Web;
4 | using WeChatTools.Core;
5 |
6 | namespace WeChatTools.API.pro
7 | {
8 | ///
9 | /// 微信小程序状态检测接口 --正式使用接口
10 | ///
11 | public class WXMiNiProCheck2 : IHttpHandler
12 | {
13 | private const int DURATION = 24 * 60;
14 | private static string userIP = "127.0.0.1";
15 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
16 | protected const string GET = "GET";
17 | public void ProcessRequest(HttpContext context)
18 | {
19 | string result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
20 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
21 | {
22 | string urlCheck = string.Empty;
23 | context.Response.ContentType = "text/plain";
24 | context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
25 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
26 | context.Response.Headers.Add("Access-Control-Allow-Methods", "GET");
27 | if (!string.IsNullOrEmpty(context.Request["appid"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
28 | {
29 | string userKey = context.Request["key"]; //key ,md5值
30 | urlCheck = context.Request["appid"]; //检测的值
31 | if (userKey.Trim() != wxCheckApiKey)
32 | {
33 | ServiceApiClient SpVoiceObj2 = null;
34 | // ServiceApiClient SpVoiceObj = null;
35 | try
36 | {
37 | //需要检测的网址
38 |
39 |
40 | if (urlCheck.StartsWith("wx") && urlCheck.Length == 18)
41 | {
42 | string json2 = "{\"Mode\":\"AuthWXMiniProKey\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
43 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
44 | SpVoiceObj2.Open();
45 | result = SpVoiceObj2.Api(json2);
46 | SpVoiceObj2.Close();
47 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
48 | {
49 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
50 | result = callBack + "(" + result + ")";
51 | }
52 | }
53 | }
54 | catch (System.ServiceModel.CommunicationException)
55 | {
56 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
57 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
58 | }
59 | catch (TimeoutException)
60 | {
61 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
62 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
63 | }
64 | catch (Exception ex)
65 | {
66 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
67 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
68 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
69 | //正式用
70 | userIP = LogTools.GetWebClientIp(context);
71 | LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
72 | }
73 |
74 |
75 | }
76 | }
77 | }
78 |
79 | context.Response.Write(result);
80 | context.Response.End();
81 |
82 |
83 | }
84 |
85 | public bool IsReusable
86 | {
87 | get
88 | {
89 | return false;
90 | }
91 | }
92 |
93 |
94 | }
95 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="wxUrlCheck.ashx.cs" Class="WeChatTools.API.pro.WXUrlCheck" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 微信域名检测接口--免费的
9 | ///
10 | public class WXUrlCheck : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | protected const string GET = "GET";
15 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey", "CheckKey");
16 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
17 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
18 | public void ProcessRequest(HttpContext context)
19 | {
20 | string result = string.Empty;
21 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
22 | {
23 | userIP = LogTools.GetWebClientIp(context);
24 | context.Response.ContentType = "text/plain";
25 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
26 |
27 | string urlCheck = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
28 |
29 | if (LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM))
30 | {
31 |
32 | if (!string.IsNullOrEmpty(context.Request["url"]))
33 | {
34 | //需要检测的网址
35 | urlCheck = context.Request["url"]; //检测的值
36 |
37 | if (!urlCheck.ToLower().Contains(".kuaizhan.com") && !urlCheck.ToLower().Contains(".luckhl8.com") && !urlCheck.ToLower().Contains(".kennethhwong.cn") && !urlCheck.ToLower().Contains(".hatai678.top") && !urlCheck.ToLower().Contains(".jszkgs.top"))
38 | {
39 | ServiceApiClient SpVoiceObj2 = null;
40 | // ServiceApiClient SpVoiceObj = null;
41 | try
42 | {
43 | bool isTrue = urlCheck.StartsWith("http");
44 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
45 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
46 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
47 | {
48 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
49 | }
50 | string apiMode = context.Request["mode"]; //检测的值
51 | if (string.IsNullOrEmpty(apiMode))
52 | {
53 | apiMode = "AuthKey0";
54 | }
55 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxCheckApiKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':1}\"}";
56 |
57 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
58 | SpVoiceObj2.Open();
59 | result = SpVoiceObj2.Api(json2);
60 | SpVoiceObj2.Close();
61 |
62 |
63 | }
64 | catch (System.ServiceModel.CommunicationException)
65 | {
66 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
67 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
68 | }
69 | catch (TimeoutException)
70 | {
71 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
72 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
73 | }
74 | catch (Exception ex)
75 | {
76 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
77 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
78 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
79 | LogTools.WriteLine(userIP + ":" + ex.Message);
80 | }
81 | }
82 | else
83 | {
84 | result = "{\"State\":false,\"Code\":\"002\",\"Data\":\"" + urlCheck + " \",\"Msg\":\"歇一歇,访问太快了,联系管理员!\"}";
85 | }
86 |
87 |
88 | }
89 | else
90 | {
91 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
92 |
93 | }
94 | }
95 | else
96 | {
97 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
98 | }
99 |
100 | }
101 |
102 | context.Response.Write(result);
103 | context.Response.End();
104 | }
105 |
106 | public bool IsReusable
107 | {
108 | get
109 | {
110 | return false;
111 | }
112 | }
113 |
114 |
115 |
116 | }
117 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck2.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="wxUrlCheck2.ashx.cs" Class="WeChatTools.API.pro.WXUrlCheck2" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck2.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 微信域名检测接口 --正式使用接口
9 | ///
10 | public class WXUrlCheck2 : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
15 | protected const string GET = "GET";
16 | public void ProcessRequest(HttpContext context)
17 | {
18 | string result = string.Empty;
19 | if (context.Request.HttpMethod.ToUpper().Equals(GET))
20 | {
21 |
22 | string urlCheck = string.Empty;
23 | context.Response.ContentType = "text/plain";
24 |
25 | context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
26 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
27 | context.Response.Headers.Add("Access-Control-Allow-Methods", "GET");
28 |
29 | if (!string.IsNullOrEmpty(context.Request["url"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
30 | {
31 | string userKey = context.Request["key"]; //key ,md5值
32 |
33 | if (userKey.Trim() == wxCheckApiKey)
34 | {
35 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
36 | }
37 | else
38 | {
39 | ServiceApiClient SpVoiceObj2 = null;
40 | // ServiceApiClient SpVoiceObj = null;
41 | try
42 | {
43 | //需要检测的网址
44 | urlCheck = context.Request["url"]; //检测的值
45 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
46 | bool isTrue = urlCheck.StartsWith("http");
47 | if (!isTrue) { urlCheck = "http://" + urlCheck; }
48 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
49 | {
50 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
51 | }
52 |
53 | string apiMode = context.Request["mode"]; //检测的值
54 | if (string.IsNullOrEmpty(apiMode))
55 | {
56 | apiMode = "AuthKey0";
57 | }
58 |
59 | string json2 = "{\"Mode\":\'" + apiMode + "\',\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
60 |
61 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
62 | SpVoiceObj2.Open();
63 | result = SpVoiceObj2.Api(json2);
64 | SpVoiceObj2.Close();
65 |
66 |
67 | if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
68 | {
69 | string callBack = context.Request.QueryString["callback"].ToString(); //回调
70 | result = callBack + "(" + result + ")";
71 | }
72 | }
73 | catch (System.ServiceModel.CommunicationException)
74 | {
75 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
76 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
77 | }
78 | catch (TimeoutException)
79 | {
80 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
81 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
82 | }
83 | catch (Exception ex)
84 | {
85 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
86 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
87 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
88 | //正式用
89 | userIP = LogTools.GetWebClientIp(context);
90 | LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
91 | }
92 |
93 |
94 | }
95 | }
96 | else
97 | {
98 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,联系管理员!\"}";
99 |
100 | }
101 | }
102 | else
103 | {
104 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
105 | }
106 | context.Response.Write(result);
107 | context.Response.End();
108 |
109 |
110 | }
111 |
112 | public bool IsReusable
113 | {
114 | get
115 | {
116 | return false;
117 | }
118 | }
119 |
120 |
121 |
122 | }
123 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck3.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="wxUrlCheck3.ashx.cs" Class="WeChatTools.API.pro.WXUrlCheck3" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/pro/wxUrlCheck3.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using WeChatTools.Core;
4 |
5 | namespace WeChatTools.API.pro
6 | {
7 | ///
8 | /// 微信域名检测接口--免费的
9 | ///
10 | public class WXUrlCheck3 : IHttpHandler
11 | {
12 | private const int DURATION = 24 * 60;
13 | private static string userIP = "127.0.0.1";
14 | protected const string POST = "POST";
15 | protected int IsFreeKey = 1;
16 | private string wxCheckApiKey = ConfigTool.ReadVerifyConfig("wxCheckApiKey3", "CheckKey");
17 | private TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;//工作时间上午08:00
18 | private TimeSpan _strWorkingDayPM = DateTime.Parse("20:00").TimeOfDay;
19 |
20 | public void ProcessRequest(HttpContext context)
21 | {
22 | string result = "{\"State\":false,\"Code\":\"003\",\"Data\":\" \",\"Msg\":\"参数错误,联系管理员!\"}";
23 | string wxKey = wxCheckApiKey; //key ,md5值
24 |
25 | string allowOrigin = "https://www.rrbay.com,http://www.wxcheckurl.com,http://www.engcloud.cn,https://gemgin.github.io,https://qqwebchat.gitee.io";
26 | string origin = context.Request.Headers.Get("Origin");
27 | string referer = context.Request.Headers.Get("Referer");
28 |
29 | if (origin != null && referer != null && (allowOrigin.Contains(origin) || origin.Contains("http://localhost:")) && referer.Length > origin.Length && context.Request.HttpMethod.ToUpper().Equals(POST))
30 | {
31 | context.Response.ContentType = "text/plain";
32 | string urlCheck = context.Request["url"];
33 | string model = context.Request["model"];
34 |
35 | if (!string.IsNullOrEmpty(urlCheck) && !string.IsNullOrEmpty(model))
36 | {
37 |
38 | if (!string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
39 | {
40 | wxKey = context.Request["key"]; //key ,md5值
41 | }
42 | if (!wxKey.ToLower().Equals(wxCheckApiKey))
43 | {
44 | IsFreeKey = 0;
45 | }
46 | else
47 | {
48 | IsFreeKey = 1;
49 | userIP = LogTools.GetWebClientIp(context);
50 | }
51 | TimeSpan dspNow = DateTime.Now.TimeOfDay;
52 | if ((IsFreeKey == 1 && LogTools.IsInTimeInterval(dspNow, _strWorkingDayAM, _strWorkingDayPM)) || IsFreeKey == 0)
53 | {
54 | if (!urlCheck.ToLower().Contains(".kuaizhan.com") && !urlCheck.ToLower().Contains(".luckhl8.com") && !urlCheck.ToLower().Contains(".kennethhwong.cn") && !urlCheck.ToLower().Contains(".hatai678.top") && !urlCheck.ToLower().Contains(".jszkgs.top"))
55 | {
56 | ServiceApiClient SpVoiceObj2 = null;
57 | // ServiceApiClient SpVoiceObj = null;
58 | try
59 | {
60 | //需要检测的网址
61 | // bool isTrue = urlCheck.StartsWith("http");
62 | // if (!isTrue && !model.Equals("AuthICPKey")) { urlCheck = "http://" + urlCheck; }
63 | urlCheck = LogTools.FilterUrl(urlCheck);//过滤
64 | if (urlCheck.StartsWith("http://") || urlCheck.StartsWith("https://"))
65 | {
66 | urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
67 | }
68 |
69 | string json2 = "{\"Mode\":\"" + model + "\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + wxKey + "\',\'UserIP\':\'" + userIP + "\',\'IsFreeKey\':'" + IsFreeKey + "'}\"}";
70 |
71 | SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
72 | SpVoiceObj2.Open();
73 | result = SpVoiceObj2.Api(json2);
74 | SpVoiceObj2.Close();
75 |
76 | }
77 | catch (System.ServiceModel.CommunicationException)
78 | {
79 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
80 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
81 | }
82 | catch (TimeoutException)
83 | {
84 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
85 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
86 | }
87 | catch (Exception ex)
88 | {
89 | // if (SpVoiceObj != null) SpVoiceObj.Abort();
90 | if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
91 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
92 | LogTools.WriteLine(userIP + ":" + wxKey + ":" + ex.Message);
93 | }
94 | }
95 | else
96 | {
97 | result = "{\"State\":false,\"Code\":\"002\",\"Data\":\"" + urlCheck + " \",\"Msg\":\"歇一歇,访问太快了,联系管理员!\"}";
98 | }
99 | }
100 | else
101 | {
102 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"测试接口,请在每天(09:00-20:00)时间段进行测试,需要讨论技术,联系管理员.\"}";
103 | }
104 |
105 | }
106 | else
107 | {
108 | result = "{\"State\":false,\"Code\":\"003\",\"Data\":\"" + userIP + "\",\"Msg\":\"参数错误,联系管理员!\"}";
109 |
110 | }
111 |
112 |
113 | }
114 |
115 | if (origin != null && (allowOrigin.Contains(origin) || origin.Contains("http://localhost:")))
116 | {
117 | context.Response.Headers.Add("Access-Control-Allow-Origin", origin);
118 | }
119 | else
120 | {
121 | context.Response.Headers.Add("Access-Control-Allow-Origin", "https://www.rrbay.com");
122 | }
123 | context.Response.Headers.Add("Access-Control-Allow-Methods", "POST");
124 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
125 | context.Response.Write(result);
126 | context.Response.End();
127 | }
128 |
129 | public bool IsReusable
130 | {
131 | get
132 | {
133 | return false;
134 | }
135 | }
136 |
137 |
138 | }
139 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/tools/hdBase64.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="hdBase64.ashx.cs" Class="WeChatTools.API.tools.hdBase64" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/tools/hdBase64.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web;
6 | using WeChatTools.Core;
7 |
8 | namespace WeChatTools.API.tools
9 | {
10 | ///
11 | /// url编码 解码
12 | ///
13 | public class hdBase64 : IHttpHandler
14 | {
15 |
16 | public void ProcessRequest(HttpContext context)
17 | {
18 | string result = string.Empty;
19 | context.Response.ContentType = "text/plain";
20 | if (context.Request.HttpMethod.ToUpper().Equals("POST"))
21 | {
22 |
23 | #region 获取post中的参数
24 | string model = context.Request.Form["model"]; //方法:编码 全编码 解码
25 | string type = context.Request.Form["type"];//编码类型 UTF8 gb2312
26 | string content = context.Request.Form["content"];
27 | #endregion
28 | try
29 | {
30 | switch (model)
31 | {
32 | case "ue":
33 | result = ToolsBase64.EncodeBase64(Encoding.GetEncoding(type), content);
34 | break;
35 | case "ud":
36 | default:
37 | result = ToolsBase64.DecodeBase64(Encoding.GetEncoding(type), content);
38 | break;
39 |
40 |
41 | }
42 |
43 | }
44 | catch (Exception ex)
45 | {
46 | result = "非法访问,联系管理员!";
47 | }
48 | }
49 | else
50 | {
51 | result = "参数错误,联系管理员!";
52 | }
53 | context.Response.Headers.Add("Access-Control-Allow-Origin", "https://www.rrbay.com");
54 | context.Response.Headers.Add("Access-Control-Allow-Methods", "POST");
55 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
56 |
57 | context.Response.Write(result);
58 | context.Response.End();
59 | }
60 |
61 |
62 | public bool IsReusable
63 | {
64 | get
65 | {
66 | return false;
67 | }
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/tools/hdUrlEncode.ashx:
--------------------------------------------------------------------------------
1 | <%@ WebHandler Language="C#" CodeBehind="hdUrlEncode.ashx.cs" Class="WeChatTools.API.tools.hdUrlEncode" %>
2 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/tools/hdUrlEncode.ashx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Web;
6 |
7 | namespace WeChatTools.API.tools
8 | {
9 | ///
10 | /// url编码 解码
11 | ///
12 | public class hdUrlEncode : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | string result = string.Empty;
18 | context.Response.ContentType = "text/plain";
19 | if (context.Request.HttpMethod.ToUpper().Equals("POST"))
20 | {
21 |
22 | #region 获取post中的参数
23 | string model = context.Request.Form["model"]; //方法:编码 全编码 解码
24 | string type = context.Request.Form["type"];//编码类型 UTF8 gb2312
25 | string content = context.Request.Form["content"];
26 | #endregion
27 | try
28 | {
29 | switch (model)
30 | {
31 | case "ue":
32 | result = UrlEncode(type, content);
33 | break;
34 | case "uae":
35 | result = UrlALLEncode(type, content);
36 | break;
37 | case "ud":
38 | default:
39 | result = UrlDecode(type, content);
40 | break;
41 |
42 |
43 | }
44 |
45 | }
46 | catch (Exception ex)
47 | {
48 | result = "非法访问,联系管理员!";
49 | }
50 | }
51 | else
52 | {
53 | result = "参数错误,联系管理员!";
54 | }
55 | context.Response.Headers.Add("Access-Control-Allow-Origin", "https://www.rrbay.com");
56 | context.Response.Headers.Add("Access-Control-Allow-Methods", "POST");
57 | context.Response.Headers.Add("Access-Control-Allow-Credentials", "true");
58 |
59 | context.Response.Write(result);
60 | context.Response.End();
61 | }
62 |
63 | //普通的编码
64 | protected string UrlEncode(string type, string content)
65 | {
66 | StringBuilder builder = new StringBuilder();
67 | builder.Append(System.Web.HttpUtility.UrlEncode(content, Encoding.GetEncoding(type)));
68 | return builder.ToString();
69 |
70 | }
71 |
72 | //全部编码
73 | protected string UrlALLEncode(string type, string content)
74 | {
75 | StringBuilder builder = new StringBuilder();
76 | foreach (char c in content)
77 | {
78 | if (System.Web.HttpUtility.UrlEncode(c.ToString()).Length > 1)
79 | {
80 | builder.Append(System.Web.HttpUtility.UrlEncode(c.ToString(), Encoding.GetEncoding(type)).ToUpper());
81 | }
82 | else
83 | {
84 | int asc = (int)c;
85 | builder.Append("%" + asc.ToString("X2"));
86 | }
87 | }
88 | return builder.ToString();
89 |
90 |
91 |
92 | }
93 |
94 | //解码
95 | protected string UrlDecode(string type, string content)
96 | {
97 | StringBuilder builder = new StringBuilder();
98 | builder.Append(System.Web.HttpUtility.UrlDecode(content, Encoding.GetEncoding(type)));
99 | return builder.ToString();
100 |
101 | }
102 | public bool IsReusable
103 | {
104 | get
105 | {
106 | return false;
107 | }
108 | }
109 | }
110 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.API/wap2wx.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 跳转中
6 |
7 |
8 |
9 |
10 |
53 |
62 |
63 |
64 |
65 |

66 |
正在跳转到微信
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/ConfigTool.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml;
7 |
8 | namespace WeChatTools.Core
9 | {
10 | public class ConfigTool
11 | {
12 | public static string xmlRootPath = System.Web.HttpRuntime.AppDomainAppPath.ToString() + "/Config";
13 |
14 | ///
15 | /// 检查配置文件是否存在
16 | ///
17 | public static bool VerifyXmlFile(string verifyName)
18 | {
19 | return System.IO.File.Exists(xmlRootPath + "/" + verifyName + ".config") == false ? false : true;
20 | }
21 | #region=============读配置==============
22 |
23 | ///
24 | /// 读取配置文件
25 | ///
26 | /// 配置节点名称
27 | /// 文件名
28 | /// 配置节点值
29 | public static string ReadVerifyConfig(string key, string verifyName)
30 | {
31 | //判断是否存在某个节点
32 | XmlDocument xmldoc = new XmlDocument();
33 | xmldoc.Load(xmlRootPath + "/" + verifyName + ".config");
34 | XmlNodeList xnl = xmldoc.SelectSingleNode("configuration").ChildNodes;
35 |
36 | string Temp = String.Empty;
37 | for (int i = 0; i < xnl.Count; i++)
38 | {
39 | XmlNode c = xnl[i];
40 | if (c.Attributes != null)
41 | {
42 | Temp = c.Attributes["key"].Value;
43 | string Value = c.Attributes["value"].Value;
44 | if (Temp == key)
45 | {
46 | return (Value.ToString() == null || Value.ToString() == "") ? "" : Value;
47 | }
48 | }
49 | }
50 | return "";
51 | }
52 |
53 | #endregion
54 | #region=============写配置==============
55 |
56 | ///
57 | ///
58 | /// 写配置节点
59 | ///
60 | /// 配置节点名称
61 | /// 配置节点值
62 | public static void WriteVerifyConfig(string key, string values, string verifyName)
63 | {
64 | //判断是否存在某个节点
65 | XmlDocument xmldoc = new XmlDocument();
66 | xmldoc.Load(xmlRootPath + "/" + verifyName + ".config");
67 | XmlNodeList xnl = xmldoc.SelectSingleNode("configuration").ChildNodes;
68 |
69 | string Temp = String.Empty;
70 | bool isExist = false;
71 | for (int i = 0; i < xnl.Count; i++)
72 | {
73 |
74 | XmlNode c = xnl[i];
75 | if (c.Attributes != null)
76 | {
77 | Temp = c.Attributes["key"].Value;
78 | if (Temp == key)
79 | {
80 | isExist = true;
81 | c.Attributes["value"].Value = values;
82 | }
83 | }
84 | }
85 | //如果不存在该节点,抛出异常
86 | if (!isExist)
87 | {
88 | throw new Exception("不存在该配置节点!");
89 | }
90 | //保存
91 | xmldoc.Save(xmlRootPath + "/" + verifyName + ".config");
92 | }
93 | #endregion
94 |
95 |
96 |
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制.更改这些特性值可修改
7 | // 与程序集关联的信息.
8 | [assembly: AssemblyTitle("WeChatTools.Core")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WeChatTools.Core")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见. 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true.
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a0bae5b1-f94c-4380-a41c-6e55fc38b399")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/ServiceApi.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成.
4 | // 运行时版本:2.0.50727.8745
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 |
12 |
13 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
14 | [System.ServiceModel.ServiceContractAttribute(ConfigurationName="IServiceApi")]
15 | public interface IServiceApi
16 | {
17 |
18 | [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IServiceApi/Api", ReplyAction="http://tempuri.org/IServiceApi/ApiResponse")]
19 | string Api(string Parameters);
20 | }
21 |
22 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
23 | public interface IServiceApiChannel : IServiceApi, System.ServiceModel.IClientChannel
24 | {
25 | }
26 |
27 | [System.Diagnostics.DebuggerStepThroughAttribute()]
28 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
29 | public partial class ServiceApiClient : System.ServiceModel.ClientBase, IServiceApi
30 | {
31 |
32 | public ServiceApiClient()
33 | {
34 | }
35 |
36 | public ServiceApiClient(string endpointConfigurationName) :
37 | base(endpointConfigurationName)
38 | {
39 | }
40 |
41 | public ServiceApiClient(string endpointConfigurationName, string remoteAddress) :
42 | base(endpointConfigurationName, remoteAddress)
43 | {
44 | }
45 |
46 | public ServiceApiClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
47 | base(endpointConfigurationName, remoteAddress)
48 | {
49 | }
50 |
51 | public ServiceApiClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
52 | base(binding, remoteAddress)
53 | {
54 | }
55 |
56 | public string Api(string Parameters)
57 | {
58 | return base.Channel.Api(Parameters);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/ToolsBase64.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace WeChatTools.Core
8 | {
9 | public sealed class ToolsBase64
10 | {
11 | ///
12 | /// Base64加密
13 | ///
14 | /// 加密采用的编码方式
15 | /// 待加密的明文
16 | ///
17 | public static string EncodeBase64(Encoding encode, string source)
18 | {
19 | byte[] bytes = encode.GetBytes(source);
20 | string enstr = "";
21 | try
22 | {
23 | enstr = Convert.ToBase64String(bytes);
24 | }
25 | catch
26 | {
27 | enstr = source;
28 | }
29 | return enstr;
30 | }
31 |
32 | ///
33 | /// Base64加密,采用utf8编码方式加密
34 | ///
35 | /// 待加密的明文
36 | /// 加密后的字符串
37 | public static string EncodeBase64(string source)
38 | {
39 | return EncodeBase64(Encoding.UTF8, source);
40 | }
41 |
42 | ///
43 | /// Base64解密
44 | ///
45 | /// 解密采用的编码方式,注意和加密时采用的方式一致
46 | /// 待解密的密文
47 | /// 解密后的字符串
48 | public static string DecodeBase64(Encoding encode, string result)
49 | {
50 | string decode = "";
51 | byte[] bytes = Convert.FromBase64String(result);
52 | try
53 | {
54 | decode = encode.GetString(bytes);
55 | }
56 | catch
57 | {
58 | decode = result;
59 | }
60 | return decode;
61 | }
62 |
63 | ///
64 | /// Base64解密,采用utf8编码方式解密
65 | ///
66 | /// 待解密的密文
67 | /// 解密后的字符串
68 | public static string DecodeBase64(string result)
69 | {
70 | return DecodeBase64(Encoding.UTF8, result);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/WeChatTools.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C5F32FC8-4863-437A-AC5C-80D94B6354C4}
8 | Library
9 | Properties
10 | WeChatTools.Core
11 | WeChatTools.Core
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | false
34 |
35 |
36 |
37 | ..\WeChatTools.API\Lib\ServiceStack.Common.dll
38 |
39 |
40 | ..\WeChatTools.API\Lib\ServiceStack.Interfaces.dll
41 |
42 |
43 | ..\WeChatTools.API\Lib\ServiceStack.Redis.dll
44 |
45 |
46 | ..\WeChatTools.API\Lib\ServiceStack.Text.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | Code
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.Core/WeiXinUrlCheck.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成.
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | using System;
12 | using System.ComponentModel;
13 | using System.Diagnostics;
14 | using System.Web.Services;
15 | using System.Web.Services.Protocols;
16 | using System.Xml.Serialization;
17 | namespace WeChatTools.Core
18 | {
19 | //
20 | // 此源代码由 wsdl 自动生成, Version=4.0.30319.33440.
21 | //
22 |
23 |
24 | ///
25 | [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.33440")]
26 | [System.Diagnostics.DebuggerStepThroughAttribute()]
27 | [System.ComponentModel.DesignerCategoryAttribute("code")]
28 | [System.Web.Services.WebServiceBindingAttribute(Name = "serviceApi", Namespace = "http://tempuri.org/")]
29 | public partial class ServiceApi : System.Web.Services.Protocols.SoapHttpClientProtocol
30 | {
31 |
32 | private System.Threading.SendOrPostCallback ApiOperationCompleted;
33 |
34 | ///
35 | public ServiceApi()
36 | {
37 | string apiUrl = ConfigTool.ReadVerifyConfig("wxCheckService", "CheckKey");
38 | this.Url = apiUrl;
39 | }
40 |
41 | ///
42 | public event ApiCompletedEventHandler ApiCompleted;
43 |
44 | ///
45 | [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/IServiceApi/Api", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
46 | [return: System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
47 | public string Api([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] string Parameters)
48 | {
49 | object[] results = this.Invoke("Api", new object[] {
50 | Parameters});
51 | return ((string)(results[0]));
52 | }
53 |
54 | ///
55 | public System.IAsyncResult BeginApi(string Parameters, System.AsyncCallback callback, object asyncState)
56 | {
57 | return this.BeginInvoke("Api", new object[] {
58 | Parameters}, callback, asyncState);
59 | }
60 |
61 | ///
62 | public string EndApi(System.IAsyncResult asyncResult)
63 | {
64 | object[] results = this.EndInvoke(asyncResult);
65 | return ((string)(results[0]));
66 | }
67 |
68 | ///
69 | public void ApiAsync(string Parameters)
70 | {
71 | this.ApiAsync(Parameters, null);
72 | }
73 |
74 | ///
75 | public void ApiAsync(string Parameters, object userState)
76 | {
77 | if ((this.ApiOperationCompleted == null))
78 | {
79 | this.ApiOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApiOperationCompleted);
80 | }
81 | this.InvokeAsync("Api", new object[] {
82 | Parameters}, this.ApiOperationCompleted, userState);
83 | }
84 |
85 | private void OnApiOperationCompleted(object arg)
86 | {
87 | if ((this.ApiCompleted != null))
88 | {
89 | System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
90 | this.ApiCompleted(this, new ApiCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
91 | }
92 | }
93 |
94 | ///
95 | public new void CancelAsync(object userState)
96 | {
97 | base.CancelAsync(userState);
98 | }
99 | }
100 |
101 | ///
102 | [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.33440")]
103 | public delegate void ApiCompletedEventHandler(object sender, ApiCompletedEventArgs e);
104 |
105 | ///
106 | [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.33440")]
107 | [System.Diagnostics.DebuggerStepThroughAttribute()]
108 | [System.ComponentModel.DesignerCategoryAttribute("code")]
109 | public partial class ApiCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
110 | {
111 |
112 | private object[] results;
113 |
114 | internal ApiCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
115 | base(exception, cancelled, userState)
116 | {
117 | this.results = results;
118 | }
119 |
120 | ///
121 | public string Result
122 | {
123 | get
124 | {
125 | this.RaiseExceptionIfNecessary();
126 | return ((string)(this.results[0]));
127 | }
128 | }
129 | }
130 | }
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | checklist3.html
10 | favicon.ico
11 | pay.html
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | x64/
18 | build/
19 | bld/
20 | [Bb]in/
21 | [Oo]bj/
22 | HNCanYou.bin/
23 |
24 | # Roslyn cache directories
25 | *.ide/
26 |
27 | # MSTest test Results
28 | [Tt]est[Rr]esult*/
29 | [Bb]uild[Ll]og.*
30 |
31 | #NUNIT
32 | *.VisualState.xml
33 | TestResult.xml
34 |
35 | # Build Results of an ATL Project
36 | [Dd]ebugPS/
37 | [Rr]eleasePS/
38 | dlldata.c
39 |
40 | *_i.c
41 | *_p.c
42 | *_i.h
43 | *.ilk
44 | *.meta
45 | *.obj
46 | *.pch
47 | *.pdb
48 | *.pgc
49 | *.pgd
50 | *.rsp
51 | *.sbr
52 | *.tlb
53 | *.tli
54 | *.tlh
55 | *.tmp
56 | *.tmp_proj
57 | *.log
58 | *.vspscc
59 | *.vssscc
60 | .builds
61 | *.pidb
62 | *.svclog
63 | *.scc
64 |
65 | # Chutzpah Test files
66 | _Chutzpah*
67 |
68 | # Visual C++ cache files
69 | ipch/
70 | *.aps
71 | *.ncb
72 | *.opensdf
73 | *.sdf
74 | *.cachefile
75 |
76 | # Visual Studio profiler
77 | *.psess
78 | *.vsp
79 | *.vspx
80 |
81 | # TFS 2012 Local Workspace
82 | $tf/
83 |
84 | # Guidance Automation Toolkit
85 | *.gpState
86 |
87 | # ReSharper is a .NET coding add-in
88 | _ReSharper*/
89 | *.[Rr]e[Ss]harper
90 | *.DotSettings.user
91 |
92 | # JustCode is a .NET coding addin-in
93 | .JustCode
94 |
95 | # TeamCity is a build add-in
96 | _TeamCity*
97 |
98 | # DotCover is a Code Coverage Tool
99 | *.dotCover
100 |
101 | # NCrunch
102 | _NCrunch_*
103 | .*crunch*.local.xml
104 |
105 | # MightyMoose
106 | *.mm.*
107 | AutoTest.Net/
108 |
109 | # Web workbench (sass)
110 | .sass-cache/
111 |
112 | # Installshield output folder
113 | [Ee]xpress/
114 |
115 | # DocProject is a documentation generator add-in
116 | DocProject/buildhelp/
117 | DocProject/Help/*.HxT
118 | DocProject/Help/*.HxC
119 | DocProject/Help/*.hhc
120 | DocProject/Help/*.hhk
121 | DocProject/Help/*.hhp
122 | DocProject/Help/Html2
123 | DocProject/Help/html
124 |
125 | # Click-Once directory
126 | publish/
127 |
128 | # Publish Web Output
129 | *.[Pp]ublish.xml
130 | *.azurePubxml
131 | ## TODO: Comment the next line if you want to checkin your
132 | ## web deploy settings but do note that will include unencrypted
133 | ## passwords
134 | *.pubxml
135 |
136 | # NuGet Packages Directory
137 | packages/*
138 | ## TODO: If the tool you use requires repositories.config
139 | ## uncomment the next line
140 | #!packages/repositories.config
141 |
142 | # Enable "build/" folder in the NuGet Packages folder since
143 | # NuGet packages use it for MSBuild targets.
144 | # This line needs to be after the ignore of the build folder
145 | # (and the packages folder if the line above has been uncommented)
146 | !packages/build/
147 |
148 | # Windows Azure Build Output
149 | csx/
150 | *.build.csdef
151 |
152 | # Windows Store app package directory
153 | AppPackages/
154 |
155 | # Others
156 | sql/
157 | *.Cache
158 | ClientBin/
159 | [Ss]tyle[Cc]op.*
160 | ~$*
161 | *~
162 | *.dbmdl
163 | *.dbproj.schemaview
164 | *.pfx
165 | *.publishsettings
166 | node_modules/
167 |
168 | # RIA/Silverlight projects
169 | Generated_Code/
170 |
171 | # Backup & report files from converting an old project file
172 | # to a newer Visual Studio version. Backup files are not needed,
173 | # because we have git ;-)
174 | _UpgradeReport_Files/
175 | Backup*/
176 | UpgradeLog*.XML
177 | UpgradeLog*.htm
178 |
179 | # SQL Server files
180 | *.mdf
181 | *.ldf
182 |
183 | # Business Intelligence projects
184 | *.rdl.data
185 | *.bim.layout
186 | *.bim_*.settings
187 |
188 | # Microsoft Fakes
189 | FakesAssemblies/
190 |
191 | # LightSwitch generated files
192 | GeneratedArtifacts/
193 | _Pvt_Extensions/
194 | ModelManifest.xml
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 404
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制.更改这些特性值可修改
7 | // 与程序集关联的信息.
8 | [assembly: AssemblyTitle("WeChatTools.UI")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WeChatTools.UI")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见.如果需要
19 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true.
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
23 | [assembly: Guid("cf5d7f57-1470-491e-932c-ef0169ba6f5c")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订版本
31 | //
32 | // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用 "*":
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/WeChatTools.UI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 |
8 |
9 | 2.0
10 | {A17F27A5-C347-4EC2-AF35-2611D8910D37}
11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
12 | Library
13 | Properties
14 | WeChatTools.UI
15 | WeChatTools.UI
16 | v4.5
17 | true
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | true
27 | full
28 | false
29 | bin\
30 | DEBUG;TRACE
31 | prompt
32 | 4
33 | false
34 |
35 |
36 | pdbonly
37 | true
38 | bin\
39 | TRACE
40 | prompt
41 | 4
42 | false
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | Web.config
83 |
84 |
85 | Web.config
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | 10.0
100 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | True
110 | True
111 | 2180
112 | /
113 | http://localhost:2181/
114 | False
115 | False
116 |
117 |
118 | False
119 |
120 |
121 |
122 |
123 |
130 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/contact.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 联系我们
7 |
8 |
9 |
10 |
58 |
70 |
71 |
72 |
73 |
76 |
77 |
78 |
79 | 支付宝
80 |
81 |
82 | 微信
83 |
84 |
85 |
86 |

87 |
88 |
89 |

90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/css/checklist.css:
--------------------------------------------------------------------------------
1 | /*浏览器样式初始化*/
2 |
3 |
4 | h1,
5 | h2,
6 | h3,
7 | h4,
8 | h5,
9 | h6,
10 | p,
11 | ul,
12 | dl,
13 | dd {
14 | margin: 0;
15 | font-weight: normal;
16 | }
17 |
18 | input,
19 | button {
20 | outline: none;
21 | }
22 |
23 | input {
24 | font-size: 14px;
25 | border: 1px solid #d7d7d7;
26 | color: #aeaeae;
27 | font-family: "Microsoft Yahei";
28 | }
29 | /*公用和hack样式*/
30 |
31 | /*功能陆续开放中*/
32 |
33 |
34 | /*检测详情页面*/
35 |
36 | .check-link {
37 | -webkit-box-shadow: 0 0 10px 1px #00c1de;
38 | box-shadow: 0 0 10px 1px #00c1de;
39 | }
40 |
41 | .check-link .domain {
42 | font-size: 28px;
43 | line-height: 93px;
44 | text-align: center;
45 | color: #fff;
46 | background-color: #00c1de;
47 | }
48 |
49 | .check-link p a {
50 | color: #1393a7;
51 | }
52 |
53 | .check-link .wx,
54 | .check-link .x5 {
55 | float: left;
56 | width: 50%;
57 | text-align: center;
58 | }
59 |
60 | .check-link img {
61 | width: 100px;
62 | margin: 30px auto;
63 | }
64 |
65 | .check-link .wx {
66 | border-right: 1px solid #d7d7d7;
67 | }
68 |
69 | .check-link .wx p {
70 | margin-bottom: 47px;
71 | font-size: 16px;
72 | color: #090723;
73 | }
74 |
75 | /*微信安全检测*/
76 | .test {
77 | width: 1000px;
78 | margin: 0 auto;
79 | padding: 33px;
80 | background-color: #fff;
81 | border-radius: 1px;
82 | }
83 |
84 | .test h2 {
85 | padding-left: 24px;
86 | border-left: 4px solid #28d0e9;
87 | font-size: 20px;
88 | line-height: 26px;
89 | }
90 |
91 | .test .title {
92 | position: relative;
93 | text-align: center;
94 | }
95 |
96 | .test .title h2 {
97 | float: left;
98 | }
99 |
100 | .test .title span {
101 | font-size: 18px;
102 | }
103 |
104 | .test .title span a {
105 | color: #ff3900;
106 | }
107 |
108 | .test .write-address {
109 | width: 100%;
110 | height: 300px;
111 | overflow-y: scroll;
112 | margin: 30px auto 20px;
113 | padding: 15px;
114 | }
115 |
116 | .test .test-btn {
117 | text-align: center;
118 | margin-bottom: 30px;
119 | }
120 |
121 | .test .test-btn button {
122 | width: 263px;
123 | border: #1ea1b5;
124 | font-size: 18px;
125 | line-height: 44px;
126 | color: #fff;
127 | background-color: #28d0e9;
128 | border-radius: 100px;
129 | }
130 |
131 | .test .list {
132 | height: 300px;
133 | overflow-y: scroll;
134 | margin: 30px auto 40px;
135 | padding: 15px 0 0 15px;
136 | border: 1px solid #d7d7d7;
137 | line-height: 1.6;
138 | color: #666;
139 | }
140 |
141 | .test .list .error a {
142 | color: #ff3900;
143 | }
144 |
145 | .test .link {
146 | margin: 30px auto;
147 | padding-left: 30px;
148 | }
149 |
150 | .test .link a {
151 | display: inline-block;
152 | padding: 0 20px;
153 | margin-bottom: 20px;
154 | color: #447bc4;
155 | }
156 |
157 | /* 手机端样式 */
158 | @media screen and (max-width: 768px) {
159 | .wrapper {
160 | width: 100%;
161 | }
162 |
163 | .test {
164 | width: 100%;
165 | padding: 10px;
166 | }
167 |
168 | .test h2 {
169 | padding-left: 10px;
170 | font-size: 16px;
171 | }
172 |
173 | .test .title h2 {
174 | float: none;
175 | text-align: left;
176 | }
177 |
178 | .test .title span {
179 | display: block;
180 | margin-top: 10px;
181 | font-size: 14px;
182 | }
183 |
184 | .test .write-address {
185 | height: 150px;
186 | margin: 15px auto 10px;
187 | padding: 5px;
188 | font-size: 14px;
189 | }
190 |
191 | .test .test-btn button {
192 | font-size: 16px;
193 | height: 40px;
194 | line-height: 40px;
195 | }
196 | }
197 |
198 |
199 | /*新加css*/
200 | .yj1 {
201 | padding: 10px 16px;
202 | line-height: 1.3333333;
203 | height: 46px;
204 | border: 2px solid #13aeb5;
205 | -moz-border-radius: 15px;
206 | -webkit-border-radius: 15px; /**/
207 | border-radius: 15px;
208 | }
209 |
210 |
211 | .test .list .error1 a {
212 | color: #ff3900;
213 | }
214 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/faq.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | FAQ - 微信域名检测技术 - 哒哒检测
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
142 |
143 |
144 |
145 |
146 |
147 |
微信域名检测接口
148 |
149 |
156 |
157 | 微信域名检测,QQ域名检测常见问题解答
158 | 更新日期:2020年08月
159 | 域名检测接口包含微信域名检测接口、QQ域名检测接口和域名备案查询接口,接口请求频率共用。
160 | 1.什么是微信域名检测接口?
161 | 微信域名检测接口是提供微信域名或者链接实时检测API接口,就是检测域名或者链接能不能直接在微信中访问.
162 | 2.什么是QQ域名检测接口?
163 | QQ域名检测接口是提供QQ域名或者链接实时检测API接口,就是检测域名或者链接能不能直接在QQ中访问.
164 | 3.什么是域名备案查询接口?
165 | 域名备案查询接口是查询域名备案ICP信息(备案主体).
166 | 4.什么是微信域名监测?
167 | 微信域名监测是为不懂技术的人员使用,购买了域名检测接口包月套餐后,免费赠送微信域名监测服务,可以在后台添加需要监测的域名,域名屏蔽了会自动邮件提醒.
168 | 5.微信域名检测有没有免费接口?
169 | 当然有,微信域名检测免费接口:免费api;接口文档,请求频率2秒,每天限制15次,请勿恶意请求.
170 | 6.QQ域名检测有没有免费接口?
171 | 当然有,QQ域名检测免费接口:免费api;接口文档,请求频率2秒,每天限制15次,请勿恶意请求.
172 | 7.什么是域名检测接口频率?
173 | 两次调用域名检测接口的间隔最低时间,单位秒,目前包月套餐有20s,2s,1s,0s(不限制频率).
174 | 8.微信域名检测接口如何购买?
175 | 第一步:注册系统账号,注册地址;
176 | 第二步:注册登陆后,后台找到【业务中心】-【域名检测接口】--【申请】;
177 | 第三步:二维码收款-->地址;
178 | 第四步:支付完通知管理员授权.
179 | 9.微信域名检测接口各种套餐报价单?
180 | 检测报价单
181 | 10.价格优惠?
182 | 域名检测接口包月套餐季付9折,半年付8折,年付7折。欢迎加盟代理,咨询QQ:391502069
183 |
184 |
185 |
186 | Copyright ©
187 |
哒哒检测
188 |
189 |
190 |
191 |
192 |
193 |
194 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/alipay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/alipay.jpg
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/bg.jpg
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/favicon.ico
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/icon-ext.png
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/icon.png
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/loading-0.gif
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/loading-1.gif
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/loading-2.gif
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/thumbnail.jpg
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/img/webchat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/WeChatTools/WeChatTools.UI/img/webchat.jpg
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/js/html5shiv.min.js:
--------------------------------------------------------------------------------
1 | (function(w,C){function v(){var e=D.elements;return"string"==typeof e?e.split(" "):e}function z(f){var e=u[f[d]];e||(e={},A++,f[d]=A,u[A]=e);return e}function c(f,e,g){e||(e=C);if(B){return e.createElement(f)}g||(g=z(e));e=g.cache[f]?g.cache[f].cloneNode():a.test(f)?(g.cache[f]=g.createElem(f)).cloneNode():g.createElem(f);return e.canHaveChildren&&!F.test(f)?g.frag.appendChild(e):e}function E(f,e){if(!e.cache){e.cache={},e.createElem=f.createElement,e.createFrag=f.createDocumentFragment,e.frag=e.createFrag()}f.createElement=function(g){return !D.shivMethods?e.createElem(g):c(g,f,e)};f.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+v().join().replace(/[\w\-]+/g,function(g){e.createElem(g);e.frag.createElement(g);return'c("'+g+'")'})+");return n}")(D,e.frag)}function b(f){f||(f=C);var e=z(f);if(D.shivCSS&&!y&&!e.hasCSS){var h,g=f;h=g.createElement("p");g=g.getElementsByTagName("head")[0]||g.documentElement;h.innerHTML="x";h=g.insertBefore(h.lastChild,g.firstChild);e.hasCSS=!!h}B||E(f,e);return f}var x=w.html5||{},F=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,a=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,y,d="_html5shiv",A=0,u={},B;(function(){try{var f=C.createElement("a");f.innerHTML="";y="hidden" in f;var e;if(!(e=1==f.childNodes.length)){C.createElement("a");var h=C.createDocumentFragment();e="undefined"==typeof h.cloneNode||"undefined"==typeof h.createDocumentFragment||"undefined"==typeof h.createElement}B=e}catch(g){B=y=!0}})();var D={elements:x.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==x.shivCSS,supportsUnknownElements:B,shivMethods:!1!==x.shivMethods,type:"default",shivDocument:b,createElement:c,createDocumentFragment:function(g,f){g||(g=C);if(B){return g.createDocumentFragment()}for(var f=f||z(g),l=f.frag.cloneNode(),k=0,j=v(),i=j.length;k #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b
2 |
3 |
4 | 页面不存在
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.UI/wx.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 联系我们 - 哒哒检测
7 |
8 |
9 |
10 |
11 |
12 |
28 |
36 |
37 |
38 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/WeChatTools/WeChatTools.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeChatTools.API", "WeChatTools.API\WeChatTools.API.csproj", "{9CA74B68-7DAC-4716-BC34-ACE55917C57B}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeChatTools.Core", "WeChatTools.Core\WeChatTools.Core.csproj", "{C5F32FC8-4863-437A-AC5C-80D94B6354C4}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeChatTools.UI", "WeChatTools.UI\WeChatTools.UI.csproj", "{A17F27A5-C347-4EC2-AF35-2611D8910D37}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {9CA74B68-7DAC-4716-BC34-ACE55917C57B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {9CA74B68-7DAC-4716-BC34-ACE55917C57B}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {9CA74B68-7DAC-4716-BC34-ACE55917C57B}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {9CA74B68-7DAC-4716-BC34-ACE55917C57B}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {C5F32FC8-4863-437A-AC5C-80D94B6354C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {C5F32FC8-4863-437A-AC5C-80D94B6354C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {C5F32FC8-4863-437A-AC5C-80D94B6354C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {C5F32FC8-4863-437A-AC5C-80D94B6354C4}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {A17F27A5-C347-4EC2-AF35-2611D8910D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {A17F27A5-C347-4EC2-AF35-2611D8910D37}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {A17F27A5-C347-4EC2-AF35-2611D8910D37}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {A17F27A5-C347-4EC2-AF35-2611D8910D37}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # GetWeixinCode
2 |
3 | 解决微信OAuth2.0网页授权只能设置一个回调域名的问题
4 |
5 | ## 使用方法
6 |
7 | 1. 部署`get-weixin-code.html`至你的微信授权回调域名的目录下
8 |
9 | 2. 使用方式类似于直接通过微信回调的方式,只是将回调地址改成了`get-weixin-code.html`所在的地址,另外省去了`response_type`参数(因为它只能为`code`)以及`#wechat_redirect`(它是固定的),它们会在`get-weixin-code.html`里面自己加上
10 |
11 | 3. `get-weixin-code.html`页面从微信那里拿到code之后会重新跳转回`redirect_uri`里面填写的url,并且在url后面带上`code`和`state`
12 |
13 | ## 详细示例
14 |
15 | 1. 前往微信公众平台->接口权限->网页授权获取用户基本信息->修改,填写授权回调页面域名,例如`www.abc.com`
16 |
17 | 2. 在`www.abc.com`域名下部署`get-weixin-code.html`,不一定是根目录,例如:`http://www.abc.com/xxx/get-weixin-code.html`
18 |
19 | 3. 假设你的`http://www.xyz.com/hello-world.html`这个页面需要获取微信授权,那么你应该使用以下地址来获取授权:`http://www.abc.com/xxx/get-weixin-code.html?appid=XXXX&scope=snsapi_base&state=hello-world&redirect_uri=http%3A%2F%2Fwww.xyz.com%2Fhello-world.html`
20 |
21 | 4. 这样最终就会跳转到这样一个地址:`http://www.xyz.com/hello-world.html?code=XXXXXXXXXXXXXXXXX&state=hello-world`,从而你就拿到了授权`code`以及自定义的`state`参数了
22 |
23 | ## 其他说明
24 |
25 | - 通过多一次的跳转,解决了微信限制回调域名只能设置一个的问题
26 |
27 | - 牺牲了一点用户体验,换来了项目部署的美感,不需要将各种项目都部署到一个域名下
28 |
29 | - 如果你有这样的需求,可以使用本项目
30 |
31 | - 欢迎提交pull request
32 |
33 | - **建议先弄懂微信授权回调的流程再使用本项目**
34 |
35 | - **很多朋友问我怎么支持第三方微信平台,这个需要对不同的第三方平台的授权方式有所了解,熟悉他们的授权方式,请求参数等。如果他们是通过在网站入口处的URL上进行授权的,那么可以使用本项目,将入口的URL改成上述的方式,如果他们是在流程中的某些页面去获取授权,那么是没法改变他们的获取地址的,所以本项目就不适用了**
--------------------------------------------------------------------------------
/doc/get-weixin-code.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 微信登录
7 |
8 |
9 |
10 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/doc/pkg/PKGDecode.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | import sys, os, struct, zlib
4 |
5 | if __name__ == "__main__":
6 | if len(sys.argv) < 3:
7 | print 'few argument'
8 | else:
9 | pkgfilename = sys.argv[1]
10 | outdirname = sys.argv[2]
11 | pkgfile = file(pkgfilename, 'rb')
12 | pkgfile.read(4)
13 | filenums, = struct.unpack('I', pkgfile.read(4))
14 | filename_table_offset, = struct.unpack('I', pkgfile.read(4))
15 | filename_table_len, = struct.unpack('I', pkgfile.read(4))
16 | pkgfile.seek(filename_table_offset)
17 | for index in range(filenums):
18 | name_len, = struct.unpack('H', pkgfile.read(2))
19 | name = pkgfile.read(name_len)
20 | pkgfile.read(4)
21 | offset, = struct.unpack('I', pkgfile.read(4))
22 | size, = struct.unpack('I', pkgfile.read(4))
23 | zlib_size, = struct.unpack('I', pkgfile.read(4))
24 | current_pos = pkgfile.tell()
25 | pkgfile.seek(offset)
26 | text = pkgfile.read(zlib_size)
27 | text = zlib.decompress(text)
28 | pkgfile.seek(current_pos)
29 | outfilename = os.path.join(outdirname, os.path.join(os.path.splitext(os.path.basename(pkgfilename))[0], name))
30 | print u'start [%d/%d]: ' %(index+1, filenums), os.path.join(os.path.splitext(os.path.basename(pkgfilename))[0], name)
31 | if not os.path.exists(os.path.dirname(outfilename)):
32 | os.makedirs(os.path.dirname(outfilename))
33 | file(outfilename, 'wb').write(text)
--------------------------------------------------------------------------------
/doc/pkg/PKGEncode.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import zlib, glob, os, sys, struct
3 |
4 | filelist = []
5 |
6 | class FileVisitor:
7 | def __init__(self, startDir=os.curdir):
8 | self.startDir = startDir
9 | def run(self):
10 | for dirname, subdirnames, filenames in os.walk(self.startDir, True):
11 | for filename in filenames:
12 | self.visit_file(os.path.join(dirname, filename))
13 | def visit_file(self, pathname):
14 | filelist.append({'filename':pathname, 'size':0, 'zlib_size':0, 'offset':0, 'relative_filename': pathname.replace(os.path.normpath(self.startDir)+os.sep, '')})
15 | #print filelist[-1]['relative_filename']
16 | if __name__ == "__main__":
17 | if len(sys.argv[1]) < 3:
18 | print 'few parameter'
19 | else:
20 | source_dirname = sys.argv[1]
21 | out_filename = sys.argv[2]
22 | FileVisitor(source_dirname).run()
23 | total = len(filelist)
24 | fp = file(out_filename + '~', 'wb')
25 | fp.write('\x64\x00\x00\x00')
26 | fp.write(struct.pack('I', len(filelist)))
27 | fp.write(struct.pack('I', 0))
28 | fp.write(struct.pack('I', 0))
29 | offset = 16
30 | for index in range(total):
31 | item = filelist[index]
32 | item['offset'] = offset
33 | infile = file(item['filename'], 'rb')
34 | text = infile.read()
35 | infile.close()
36 | item['size'] = len(text)
37 | text = zlib.compress(text)
38 | item['zlib_size'] = len(text)
39 | fp.write(text)
40 | offset += item['zlib_size']
41 | print u'zipd %d/%d' % (index+1, total)
42 | filename_table_offset = offset
43 | for index in range(total):
44 | item = filelist[index]
45 | fp.write(struct.pack('H', len(item['relative_filename'])))
46 | fp.write(item['relative_filename'])
47 | fp.write('\x01\x00\x00\x00')
48 | fp.write(struct.pack('I', item['offset']))
49 | fp.write(struct.pack('I', item['size']))
50 | fp.write(struct.pack('I', item['zlib_size']))
51 | offset += 2 + len(item['relative_filename']) + 16
52 | print u'outd %d/%d' % (index+1, total)
53 | filename_table_len = offset - filename_table_offset
54 | fp.close()
55 |
56 | fp = file(out_filename + '~', 'rb')
57 | ret = file(out_filename, 'wb')
58 |
59 | fp.read(16)
60 | ret.write('\x64\x00\x00\x00')
61 | ret.write(struct.pack('I', len(filelist)))
62 | ret.write(struct.pack('I', filename_table_offset))
63 | ret.write(struct.pack('I', filename_table_len))
64 |
65 | copy_bytes = 16
66 | total_bytes = offset
67 | while True:
68 | text = fp.read(2**20)
69 | ret.write(text)
70 | copy_bytes += len(text)
71 | print u'copied %d%%' % (copy_bytes*100.0/total_bytes)
72 | if not text:
73 | break
74 | fp.close()
75 | ret.close()
76 | os.remove(out_filename + '~')
--------------------------------------------------------------------------------
/doc/微信域名检测接口调用文档.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gemgin/WeChatTools/f452a066aa0af3a0d10709b99b32a39aa30aacc4/doc/微信域名检测接口调用文档.doc
--------------------------------------------------------------------------------
/微信小程序状态检测接口.md:
--------------------------------------------------------------------------------
1 | # 微信工具集
2 | [](LICENSE)
3 | [](https://github.com/gemgin/WeChatTools/pulls)
4 | [](https://github.com/gemgin/WeChatTools)
5 | [](https://github.com/gemgin/WeChatTools)
6 |
7 | [交流QQ群:20772662](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=IeDjmP0tr9iYWunmNVU7LzAXcgH-h01H&authKey=7oy9vFrVLwRJhCa6Gpl5A6Ia5k%2FDENWfqEmq%2F8UWzRHtHcvRv0PIrSpoAFEp1PLE&noverify=0&group_code=20772662 "QQ群:20772662"),[QQ:391502069](http://wpa.qq.com/msgrd?v=3&uin=391502069&site=qq&menu=yes "QQ:391502069")
8 |
9 | ## 项目介绍
10 | > 微信小程序状态查询
11 | - 实时检测微信小程序状态,能否正常访问
12 |
13 |
14 | ## 使用
15 | - 微信域名检测试用接口 [http://wx.rrbay.com/pro/wxUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/wxUrlCheck.ashx?url=http://www.teu7.cn "微信域名检测试用接口")
16 | - QQ域名检测试用接口 [http://wx.rrbay.com/pro/qqUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/qqUrlCheck.ashx?url=http://www.teu7.cn "QQ域名检测试用接口")
17 | - 抖音域名检测试用接口 [http://wx.rrbay.com/pro/dyUrlCheck.ashx?url=http://www.teu7.cn](http://wx.rrbay.com/pro/dyUrlCheck.ashx?url=http://www.teu7.cn "抖音域名检测试用接口")
18 | - 域名备案查询接口 [http://wx.rrbay.com/pro/icpCheck.ashx?url=http://www.rrbay.com](http://wx.rrbay.com/pro/icpCheck.ashx?url=http://www.rrbay.com "域名备案查询接口")
19 |
20 | - 微信小程序状态接口 [http://wx.rrbay.com/pro/wxMiNiProCheck.ashx?appid=wxd123456789abcdef](http://wx.rrbay.com/pro/wxMiNiProCheck.ashx?appid=wxd123456789abcdef "微信小程序状态查询接口")
21 |
22 | ```
23 | {"State":true, "Code","101","Data":"wxd123456789abcdef","Msg":"因违规已暂停服务"}
24 | {"State":true, "Code","102","Data":"wxd123456789abcdef","Msg":"微信小程序状态正常"}
25 | {"State":true, "Code","103","Data":"wxd123456789abcdef","Msg":"微信小程序更新维护,系统故障或开发已暂停服务"}
26 | {"State":false,"Code","001","Data":"wxd123456789abcdef","Msg":"非法访问,访问被拒绝,联系管理员qq:391502069"}
27 | {"State":false,"Code","001","Data":"wxd123456789abcdef","Msg":"微信小程序appid不存在"}
28 | {"State":false,"Code","002","Data":"wxd123456789abcdef","Msg":"歇一歇,访问太快了,联系管理员qq:391502069"}
29 | {"State":false,"Code","003","Data":"wxd123456789abcdef","Msg":"服务暂停,请联系管理员!"}
30 | ```
31 | - 检测界面:http://h5.wxcheckurl.com/
32 |
33 | ### 顶尖技术,铸就稳定服务
34 |
35 | 微信域名检测接口采用基于系统服务开发,接口快速、稳定。
36 |
37 | ### 官方接口,实时结果
38 |
39 | 微信域名检测采用官方接口,实时返回查询结果,准确率99.99%,API接口响应速度快,平均检测时间只需0.2秒
40 |
41 | ### 在线自助查询/API集成查询
42 |
43 | 微信域名检测接口支持多域名不限次数提交查询,web端在线查询返回结果,无需安装插件或客户端。支持API查询、支持集成到自由系统或第三方系统
44 |
45 | ### 为用户定制的域名自动监测系统
46 |
47 | 为了方便用户,可以为用户开发了一套域名自动检测自动切换系统,保证微信公众号活动正常进行。
48 |
49 | > 积攒star=18000,微信域名检测核心代码和原理将在码云和github完全公开,如果你需要请star
50 |
51 | ## 2018-01-29 微信域名检测系统升级说明
52 | - 数据库mongodb连接安全问题(部署不当,会造成重大安全漏洞)
53 | - 微信域名检测key授权与微信域名检测服务分离,方便部署和后期运营
54 | - 优化微信域名检测服务接口
55 | - 检测入口分布式部署以及负载均衡
56 |
57 | ## 2018-08-20 微信链接推广系统升级说明
58 | - 推广系统接收中转分离
59 | - 中转统一采用redis
60 | - 优化实时检测自动更换逻辑--采用每个小时检测某分钟检测
61 |
62 | ## 2018-08-23 微信域名检测系统升级说明
63 | - 微信域名检测底层服务升级改造
64 | - 采集cookie与检测服务分离
65 | - redis与mongodb分离
66 |
67 | ## 2018-12-17 微信域名检测系统升级说明
68 | - 微信域名监测服务上线
69 | - 域名qq检测上线
70 | - 同一个key可以微信检测,qq检测以及微信域名监测结果微信通知
71 |
72 | ## 2019-09-29 微信域名检测系统升级说明
73 | - 域名备案信息查询服务上线
74 | - 同一个key可以微信检测,qq检测以及域名备案信息查询
75 |
76 | ## 2021-04-19 域名检测系统升级说明
77 | - 抖音域名安全检测接口上线
78 | - 同一个key可以微信检测,qq检测,抖音域名检测以及域名备案信息查询
79 |
80 | ## 2022-05-24 检测系统升级说明
81 | - 微信小程序状态检测接口上线
82 | - 同一个key可以微信检测,微信小程序状态,qq检测,抖音域名检测以及域名备案信息查询
--------------------------------------------------------------------------------