PageSourceSearch

https://dc1979.com/dot-net-wechat-dev-intro/index.html

html dc1979.com collected 2026-09-28 05:44:05 UTC 6,750 bytes, 148 lines download raw bytes

1<html>
2  <head>
3	  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4    <title>微信公众平台开发入门(使用.NET)-- joelz</title>
5		<link href="toc/style/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css" media="all" rel="stylesheet" type="text/css"/>
6		<link href="toc/style/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css" media="all" rel="stylesheet" type="text/css"/>
7		<link href="toc/css/zTreeStyle/zTreeStyle.css" media="all" rel="stylesheet" type="text/css"/>
8	  <style>
9		pre {
10		    counter-reset: line-numbering;
11		    border: solid 1px #d9d9d9;
12		    border-radius: 0;
13		    background: #fff;
14		    padding: 0;
15		    line-height: 23px;
16		    margin-bottom: 30px;
17		    white-space: pre;
18		    overflow-x: auto;
19		    word-break: inherit;
20		    word-wrap: inherit;
21		}
22
23		pre a::before {
24		  content: counter(line-numbering);
25		  counter-increment: line-numbering;
26		  padding-right: 1em; /* space after numbers */
27		  width: 25px;
28		  text-align: right;
29		  opacity: 0.7;
30		  display: inline-block;
31		  color: #aaa;
32		  background: #eee;
33		  margin-right: 16px;
34		  padding: 2px 10px;
35		  font-size: 13px;
36		  -webkit-touch-callout: none;
37		  -webkit-user-select: none;
38		  -khtml-user-select: none;
39		  -moz-user-select: none;
40		  -ms-user-select: none;
41		  user-select: none;
42		}
43
44		pre a:first-of-type::before {
45		  padding-top: 10px;
46		}
47
48		pre a:last-of-type::before {
49		  padding-bottom: 10px;
50		}
51
52		pre a:only-of-type::before {
53		  padding: 10px;
54		}
55
56		.highlight { background-color: #ffffcc } /* RIGHT */
57		</style>
58  </head>
59  <body>
60	  <div>
61				<div style='width:25%;'>
62						<ul id="tree" class="ztree" style='width:100%'>
63
64						</ul>
65				</div>
66        <div id='readme' style='width:70%;margin-left:20%;'>
67          	<article class='markdown-body'>
68            	<h1 id="-net-">微信公众平台开发入门(使用.NET)</h1>
69<h2 id="-">为什么要学习微信开发?</h2>
70<ol>
71<li>微信的用户量巨大,已经成为一个平台</li>
72<li>移动时代,你需要学会App开发。但是,有人说:<a href="http://mp.weixin.qq.com/s?__biz=MjM5ODQwMjA4MA==&amp;mid=2649293557&amp;idx=1&amp;sn=98f34bb53a54331887cb99972c89e1bc&amp;scene=1&amp;srcid=0814pzrNvADLn20Poq0XWwKW#rd">别开发  app 了</a></li>
73<li>学习微信公众平台 API 的设计。這是一个互联时代,到处都是 API 。</li>
74</ol>
75<h2 id="-">微信开发出来的应用长什么样?</h2>
76<ol>
77<li>记账机器人</li>
78<li>信昌信息科技</li>
79</ol>
80<h2 id="-">概述</h2>
81<ol>
82<li><a href="https://mp.weixin.qq.com/wiki">微信公众平台开发文档</a>:
83 <img src="wechat-doc.png" alt="微信公众平台开发文档"></li>
84<li>两种交互形式:消息会话;公众号内网页。
85消息会话:群发消息;被动回复消息;客服消息;模板消息。
86公众号内网页:网页授权获取用户基本信息;微信JS-SDK(开发者在网页上通过JavaScript代码使用微信原生功能的工具包,开发者可以使用它在网页上录制和播放微信语音、监听微信分享、上传手机本地图片、拍照等许多能力)</li>
87<li>微信公众号应用的架构:
88<img src="wechat-arch.png" alt="微信公众号应用的架构"></li>
89<li>微信公众号接口分类:
90<img src="wechat-api-type.jpg" alt="微信公众号接口分类"></li>
91</ol>
92<h2 id="-">基本概念</h2>
93<ol>
94<li>微信公众号的分类:订阅号,服务号,企业号,三者有<a href="https://kf.qq.com/faq/140806zARbmm140826M36RJF.html">区别</a>。个人可以申请到订阅号和企业号,但是无法申请认证。</li>
95<li>开发和测试可以使用测试号,申请很方便。<a href="http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login">测试号申请入口</a></li>
96<li>微信公众号的原始ID,AppID(应用ID),AppSecret(应用密钥),<a href="http://mp.weixin.qq.com/wiki/11/0e4b294685f817b95cbed85ba5e82b8f.html">access_token</a>,</li>
97<li>URL(服务器地址,必须是80端口或者443端口),Token(令牌) ,EncodingAESKey(消息加解密密钥)。</li>
98<li>openid</li>
99<li>域名:业务域名,JS接口安全域名,OAuth网页授权回调域名。域名必须备案。</li>
100<li>接入指南:<a href="http://mp.weixin.qq.com/wiki/17/2d4265491f12608cd170a95559800f2d.html">微信公众平台接入指南</a></li>
101</ol>
102<h2 id="-">准备工作</h2>
103<ol>
104<li>用自己的微信申请测试号</li>
105<li>我没有备案过的域名,也没有外网可以访问的服务器,怎么办?<a href="https://natapp.cn/">NATAPP 基于ngrok高速内网穿透服务</a></li>
106<li><a href="https://natapp.cn/article/natapp_newbie">NATAPP1分钟快速新手图文教程 - NATAPP 基于ngrok高速内网穿透服务</a></li>
107<li>开源世界有惊喜,<a href="https://github.com/JeffreySu/WeiXinMPSDK">GitHub上有.NET平台下的微信公众平台SDK封装</a></li>
108</ol>
109<h2 id="-">记账机器人的实现</h2>
110<ol>
111<li>下载WeiXinMPSDK的.NetFx 4.0版本,编译部署到本地</li>
112<li>配置NATAPP,确保外网能访问</li>
113<li>处理用户关注事件:<a href="http://mp.weixin.qq.com/wiki/2/5baf56ce4947d35003b86a9805634b1e.html">接收事件推送</a></li>
114<li>处理消息自动回复:<a href="http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html">接收普通消息</a></li>
115</ol>
116<h2 id="-js-sdk-demo">微信JS SDK demo</h2>
117<ol>
118<li>配置JS接口安全域名</li>
119<li>自定义菜单 API :<a href="http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html">自定义菜单创建接口</a></li>
120<li>扫一扫及分享到朋友圈:<a href="http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html">微信JS-SDK说明文档</a></li>
121</ol>
122<h2 id="-">入门之后...</h2>
123<ol>
124<li>OAuth网页授权</li>
125<li>H5开发:<a href="https://github.com/weui/weui">GitHub - weui/weui: A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.</a></li>
126</ol>
127
128          	</article>
129        </div>
130		</div>
131  </body>
132</html>
133<script type="text/javascript" src="toc/js/jquery-1.4.4.min.js"></script>
vendor: 2 bytes, line 133
133
134<script type="text/javascript" src="toc/js/jquery.ztree.all-3.5.min.js"></script>
vendor: 2 bytes, line 134
134
135<script type="text/javascript" src="toc/js/ztree_toc.js"></script>
vendor: 2 bytes, line 135
135
136<script type="text/javascript" src="toc_conf.js"></script>
136
137
138<SCRIPT type="text/javascript" >
139<!--
140$(document).ready(function(){
141    var css_conf = eval(markdown_panel_style);
142    $('#readme').css(css_conf)
143    
144    var conf = eval(jquery_ztree_toc_opts);
145		$('#tree').ztree_toc(conf);
146});
147//-->
148</SCRIPT>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.