热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

asp.net微信开发已关注用户管理步骤详解

这篇文章主要介绍了asp.net微信开发中有关已关注用户管理的相关内容,需要的朋友可以参考下
这篇文章主要介绍了asp.net微信开发中有关已关注用户管理的相关内容,需要的朋友可以参考下

公众号可通过本接口来获取帐号的关注者列表,关注者列表由一串OpenID(加密后的微信号,每个用户对每个公众号的OpenID是唯一的)组成。一次拉取调用最多拉取10000个关注者的OpenID,可以通过多次拉取的方式来满足需求。

接口调用请求说明

http请求方式: GET(请使用https协议)

返回结果:

{
 "total":23000,
 "count":10000,
 "data":{"
 openid":[
 "OPENID1",
 "OPENID2",
 ...,
 "OPENID10000"
 ]
 },
 "next_openid":"OPENID10000"
}


https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID1
返回结果:


{
 "total":23000,
 "count":10000,
 "data":{
 "openid":[
 "OPENID10001",
 "OPENID10002",
 ...,
 "OPENID20000"
 ]
 },
 "next_openid":"OPENID20000"
}


https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID2
返回结果(关注者列表已返回完时,返回next_openid为空):


{
 "total":23000,
 "count":3000,
 "data":{"
 "openid":[
  "OPENID20001",
  "OPENID20002",
  ...,
  "OPENID23000"
 ]
 },
 "next_openid":"OPENID23000"
}

微信官方网站后台的接口权限表里(以服务号为例)每天调用的获取用户列表能获取500次,获取用户基本信息可以获取500000次,所以说接下来,我在获取用户列表的时候,会用到缓存,别看500次不少了,
可是真正的用起来快得不得了,先上效果图如下:

创建一个用于存储openId的类

public class WxOpenIdInfo
 {
 public string WxopenId { get; set; }//用户存放微信用户的openId
 }

然后再创建用户信息的基本类

 /// 
 /// 微信用户基本信息类
 /// 
 public class WxUserInfo
 {
 public int subscribe { get; set; }//关注状态

 public string openid { get; set; }//OpenID

 public string nickname { get; set; }//昵称

 public string sex { get; set; }//性别

 public string city { get; set; }//城市

 public string province { get; set; }//省份

 public string headimgurl { get; set; }//头像图片地址

 public string subscribe_time { get; set; }//关注时间

 public string remark { get; set; }//备注

 public string groupid { get; set; }//分组ID

 }

用户列表前台代码

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeiXinUserList.aspx.cs" Inherits="DQWebSite.Administrator.WeiXinUserList" %>






 
 
 

 
 


 
 

位置:

  • 首页
  • 微信管理
  • 德桥员工服务中心--关注者列表管理

新建分组关闭

30字符以内

确定创建

已关注人数

全选

+ 新建分组

分组管理

刷 新

<%--

查询

--%>

OpenID 头像 昵称(备注名) 关注时间 所属分组 操作
<%--OnCheckedChanged="CheckIn_CheckedChanged"--%> 分组名称 &#39;>

修改备注名称

确定 >>| > < |<< 当前第 页/ 共搜索到 条记录.

获取用户列表绑定用户信息的后台代码,已包括,修改备注名,将用户移动到分组,新建分组代码

分组统计,用于显示每个分组的已存在人数,无其他作用

上代码:

 PagedDataSource pds = new PagedDataSource();
 protected void Page_Load(object sender, EventArgs e)
 {
  if(!Page.IsPostBack)
  {
  BindGroupList();
  BindGetAllUserOpenIdList();
  this.DataBind();
  this.CheckAll.AutoPostBack = true;
  this.DDlAddgroups.AutoPostBack = true;
  }
  //this.DDlAddgroups.Enabled = false;
  
 }
 /// 
 /// 获取所有用户的openId列表
 /// 
 private void BindGetAllUserOpenIdList()
 {
  WeiXinServer wxs = new WeiXinServer();

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
  //如果为空,重新获取
  Access_token = wxs.GetAccessToken();

  //设置缓存的数据7000秒后过期
  Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);

  string jsOnres= "";

  string cOntent= Cache["AllUserOpenList_content"] as string;

  if (cOntent== null)
  {
  jsOnres= "https://api.weixin.qq.com/cgi-bin/user/get?access_token=" + Access_tokento;

  HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(jsonres);
  myRequest.Method = "GET";
  HttpWebResponse myRespOnse= (HttpWebResponse)myRequest.GetResponse();
  StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  cOntent= reader.ReadToEnd();
  reader.Close();

  //设置缓存的数据7000秒后过期
  Cache.Insert("AllUserOpenList_content", content, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  //使用前需要引用Newtonsoft.json.dll文件
  JObject jsOnObj= JObject.Parse(content);


  int totalnum = int.Parse(jsonObj["count"].ToString());


  List openidlist = new List();


  for (int i = 0; i 
 /// 绑定分组列表
 /// 
 private void BindGroupList()
 {
  WeiXinServer wxs = new WeiXinServer();

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
  //如果为空,重新获取
  Access_token = wxs.GetAccessToken();

  //设置缓存的数据7000秒后过期
  Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);

  string jsOnres= "";

  string cOntent= Cache["AllGroups_content"] as string;

  if (cOntent== null)
  {
  jsOnres= "https://api.weixin.qq.com/cgi-bin/groups/get?access_token=" + Access_tokento;

  HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(jsonres);
  myRequest.Method = "GET";
  HttpWebResponse myRespOnse= (HttpWebResponse)myRequest.GetResponse();
  StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  cOntent= reader.ReadToEnd();
  reader.Close();

  //设置缓存的数据7000秒后过期
  Cache.Insert("AllGroups_content", content, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  //使用前需要引用Newtonsoft.json.dll文件
  JObject jsOnObj= JObject.Parse(content);


  int groupsnum = jsonObj["groups"].Count();

  this.DDLgroups.Items.Clear();//清除
  this.DDlAddgroups.Items.Clear();
  this.DDLgroups.Items.Insert(0, new ListItem("分组统计", "0"));//添加默认第一个提示
  this.DDlAddgroups.Items.Insert(0, new ListItem("移动用户到分组", "0"));
  for (int i = 0; i 
 /// 输入页码提交跳转
 /// 
 /// 
 /// 
 protected void LinkBtnToPage_Click(object sender, EventArgs e)
 {

  if (String.IsNullOrWhiteSpace(this.txtPageIndex.Text.ToString().Trim()))
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;页码不能为空!&#39;)", true);
  this.txtPageIndex.Focus();
  return;
  }
  if (IsNum(this.txtPageIndex.Text.ToString().Trim()))
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;页码数只能输入数字!&#39;)", true);
  this.txtPageIndex.Focus();
  this.txtPageIndex.Text = this.lbPageIndex.Text.ToString();
  return;
  }
  if (int.Parse(this.txtPageIndex.Text.ToString().Trim()) > int.Parse(this.lbCountPage.Text.ToString().Trim()))
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;所输页数不能大于总页数!&#39;)", true);
  this.txtPageIndex.Focus();
  this.txtPageIndex.Text = this.lbPageIndex.Text.ToString();
  return;
  }

  BindGetAllUserOpenIdList();
 }
 /// 
 /// 判断是否是数字
 /// 
 /// 
 /// 
 public static bool IsNum(string text) //
 {
  for (int i = 0; i 
 /// 绑定用户基本信息事件
 /// 
 /// 
 /// 
 protected void RepeaterWxUserList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
  //CheckBox checkIn = e.Item.FindControl("CheckIn") as CheckBox;

  //checkIn.AutoPostBack = true;


  if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
  {
  WxOpenIdInfo wxopen = e.Item.DataItem as WxOpenIdInfo;


  Label lbwxopenID = e.Item.FindControl("lbwxopenID") as Label;

  lbwxopenID.Text = wxopen.WxopenId.ToString();

  //根据OpenID获取用户基本信息。缓存处理
  WeiXinServer wxs = new WeiXinServer();

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
   //如果为空,重新获取
   Access_token = wxs.GetAccessToken();

   //设置缓存的数据7000秒后过期
   Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);

  string jsOnres="https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + Access_tokento + "&openid=" + lbwxopenID.Text.ToString();

  HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(jsonres);
  myRequest.Method = "GET";
  HttpWebResponse myRespOnse= (HttpWebResponse)myRequest.GetResponse();
  StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  string cOntent= reader.ReadToEnd();
  reader.Close();

  //使用前需要引用Newtonsoft.json.dll文件
  JObject jsOnObj= JObject.Parse(content);


  Image ImgHeadUrl = e.Item.FindControl("ImgHeadUrl") as Image;
  Label lbNickName = e.Item.FindControl("lbNickName") as Label;
  Label lbRemark = e.Item.FindControl("lbRemark") as Label;
  Label lbSubscrine_time = e.Item.FindControl("lbSubscrine_time") as Label;

  Label lbgroupId = e.Item.FindControl("lbgroupId") as Label;

  DropDownList DDlAddgroupss = e.Item.FindControl("DDlAddgroupss") as DropDownList;

  lbNickName.Text = jsonObj["nickname"].ToString();

  if (!String.IsNullOrWhiteSpace(jsonObj["remark"].ToString()))
  {
   lbRemark.Text = "(" + jsonObj["remark"].ToString() + ")";
  }

  ImgHeadUrl.ImageUrl = jsonObj["headimgurl"].ToString();
  lbgroupId.Text = jsonObj["groupid"].ToString();

  //获取关注时间
  int totaltiem = int.Parse(jsonObj["subscribe_time"].ToString());
  //将整型格式时间转换为时间格式
  DateTime t = new DateTime(1970, 1, 1).AddSeconds(totaltiem);
  //转换后的时间会比原有时间小8个小时,因此需要加上8个小时
  lbSubscrine_time.Text = t.AddHours(8).ToString();


  string jjjjjjjjjddd = Cache["AllGroups_content"] as string;

  if (jjjjjjjjjddd == null)
  {
   jsOnres= "https://api.weixin.qq.com/cgi-bin/groups/get?access_token=" + Access_tokento;

   HttpWebRequest myRequestss = (HttpWebRequest)WebRequest.Create(jsonres);
   myRequest.Method = "GET";
   HttpWebResponse myRespOnsess= (HttpWebResponse)myRequest.GetResponse();
   StreamReader readerss = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
   jjjjjjjjjddd = reader.ReadToEnd();
   reader.Close();

   //设置缓存的数据7000秒后过期
   Cache.Insert("AllGroups_content", jjjjjjjjjddd, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  //使用前需要引用Newtonsoft.json.dll文件
  JObject jsOnObjss= JObject.Parse(jjjjjjjjjddd);


  int groupsnumss = jsonObjss["groups"].Count();

  for (int i = 0; i 
 /// 创建分组
 /// 
 /// 
 /// 
 protected void LinkBtnCreateGroup_Click(object sender, EventArgs e)
 {
  if (this.txtgroupsName.Value.ToString().Equals("分组名称"))
  {
  ////
  ScriptManager.RegisterClientScriptBlock(this.Page,this.GetType(),"","alert(&#39;不能为空!&#39;)",true);
  this.txtgroupsName.Focus();
  return;
  }


  WeiXinServer wxs = new WeiXinServer();
  string res = "";

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
  //如果为空,重新获取
  Access_token = wxs.GetAccessToken();

  //设置缓存的数据7000秒后过期
  Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);


  string posturl = "https://api.weixin.qq.com/cgi-bin/groups/create?access_token=" + Access_tokento;

  //string postData = "{\"group\":{\"name\":\""+this.txtgroupsName.Value.ToString().Trim()+"\"}}";

  string postData = "{\"group\":{\"name\":\""+this.txtgroupsName.Value.ToString().Trim()+"\"}}";


  res = wxs.GetPage(posturl, postData);


  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;创建成功!如未显示,请退出重新登录即可!&#39;);location=&#39;WeiXinUserList.aspx&#39;;", true);
 }
 /// 
 /// 全选、全不选
 /// 
 /// 
 /// 
 protected void CheckAll_CheckedChanged(object sender, EventArgs e)
 {
  CheckBox checkAll = (CheckBox)sender;
  foreach (RepeaterItem item in this.RepeaterWxUserList.Items)
  {
  CheckBox checkIn = (CheckBox)item.FindControl("CheckIn");
  checkIn.Checked = checkAll.Checked;
  }
 }

 /// 
 /// 移动用户到分组
 /// 
 /// 
 /// 
 protected void DDlAddgroups_SelectedIndexChanged(object sender, EventArgs e)
 {
  ///取得分组ID
  string groupId = this.DDlAddgroups.SelectedValue.ToString();

  //this.Label1.Text = groupId.ToString();

  Boolean bools = false;

  foreach (RepeaterItem item in this.RepeaterWxUserList.Items)
  {
  CheckBox checkIn = (CheckBox)item.FindControl("CheckIn");

  if (checkIn.Checked)
  {
   bools = true;

   Label lbwxopenID = item.FindControl("lbwxopenID") as Label;


   WeiXinServer wxs = new WeiXinServer();
   string res = "";

   ///从缓存读取accesstoken
   string Access_token = Cache["Access_token"] as string;

   if (Access_token == null)
   {
   //如果为空,重新获取
   Access_token = wxs.GetAccessToken();

   //设置缓存的数据7000秒后过期
   Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
   }

   string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);


   string posturl = "https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token=" + Access_tokento;


   //POST数据例子:{"openid":"oDF3iYx0ro3_7jD4HFRDfrjdCM58","to_groupid":108}
   //string postData = "{\"openid\":\"" + openid.ToString().Trim() + "\",\"remark\":\"" + this.txtRemarkName.Value.ToString() + "\"}";

   string postData = "{\"openid\":\"" + lbwxopenID.Text.ToString() + "\",\"to_groupid\":\"" + groupId.ToString() + "\"}";


   res = wxs.GetPage(posturl, postData);


   //使用前需要引用Newtonsoft.json.dll文件
   JObject jsOnObj= JObject.Parse(res);

   ///获取返回结果的正确|true|false,
   string isright = jsonObj["errcode"].ToString();//0
   string istrueorfalse = jsonObj["errmsg"].ToString();//ok
   if (isright.Equals("0") && istrueorfalse.Equals("ok"))
   {
   ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;移动用户成功!&#39;);location=&#39;WeiXinUserList.aspx&#39;;", true);
   }
   else
   {
   ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;移动用户失败!&#39;);", true);
   return;
   }
  }

  }
  if (!bools)
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;未选中项!&#39;);location=&#39;WeiXinUserList.aspx&#39;;", true);
  return;
  }
 }

WeiXinServer wxs = new WeiXinServer();是单独创建的一个类,主要用来获取通行证和加载流的方法,代码如下:

 /// 
 /// 微信服务类
 /// 
 public class WeiXinServer
 {
 /// 
 /// 获取通行证
 /// 
 /// 
 public string GetAccessToken()
 {
  string url_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=此处应该填写公众的appid&secret=此处应该填写公众号的secret";
  HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url_token);
  myRequest.Method = "GET";
  HttpWebResponse myRespOnse= (HttpWebResponse)myRequest.GetResponse();
  StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  string cOntent= reader.ReadToEnd();
  reader.Close();
  return content;
 }
 public string GetPage(string p, string postData)
 {
  Stream outstream = null;
  Stream instream = null;
  StreamReader sr = null;
  HttpWebResponse respOnse= null;
  HttpWebRequest request = null;
  Encoding encoding = Encoding.UTF8;
  byte[] data = encoding.GetBytes(postData);
  // 准备请求...
  try
  {
  // 设置参数
  request = WebRequest.Create(p) as HttpWebRequest;
  COOKIEContainer COOKIECOntainer= new COOKIEContainer();
  request.COOKIECOntainer= COOKIEContainer;
  request.AllowAutoRedirect = true;
  request.Method = "POST";
  request.COntentType= "application/x-www-form-urlencoded";
  request.COntentLength= data.Length;
  outstream = request.GetRequestStream();
  outstream.Write(data, 0, data.Length);
  outstream.Close();
  //发送请求并获取相应回应数据
  respOnse= request.GetResponse() as HttpWebResponse;
  //直到request.GetResponse()程序才开始向目标网页发送Post请求
  instream = response.GetResponseStream();
  sr = new StreamReader(instream, encoding);
  //返回结果网页(html)代码
  string cOntent= sr.ReadToEnd();
  string err = string.Empty;
  return content;
  }
  catch (Exception ex)
  {
  string err = ex.Message;
  return string.Empty;
  }
 }
 }

修改备注页面的代码:

 protected void Page_Load(object sender, EventArgs e)
 {
  if(Request.QueryString["id"]!=null)
  {
  String openid = Request.QueryString["id"].ToString();
  this.txtOpenId.Value = openid.ToString();

  //根据OpenID获取用户基本信息。缓存处理
  WeiXinServer wxs = new WeiXinServer();

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
   //如果为空,重新获取
   Access_token = wxs.GetAccessToken();

   //设置缓存的数据7000秒后过期
   Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);

  string jsOnres= "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + Access_tokento + "&openid=" + openid;

  HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(jsonres);
  myRequest.Method = "GET";
  HttpWebResponse myRespOnse= (HttpWebResponse)myRequest.GetResponse();
  StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  string cOntent= reader.ReadToEnd();
  reader.Close();

  //使用前需要引用Newtonsoft.json.dll文件
  JObject jsOnObj= JObject.Parse(content);

        //假如备注名不为空,给备注名文本框赋值,显示原有的备注名
  if (!String.IsNullOrWhiteSpace(jsonObj["remark"].ToString()))
  {
   this.txtRemarkName.Value = jsonObj["remark"].ToString();
  }

  }
 }
 /// 
 /// 设置备注名
 /// 
 /// 
 /// 
 protected void LinkBtnSet_Click(object sender, EventArgs e)
 {
  

  String openid = Request.QueryString["id"].ToString();

  WeiXinServer wxs = new WeiXinServer();
  string res = "";

  ///从缓存读取accesstoken
  string Access_token = Cache["Access_token"] as string;

  if (Access_token == null)
  {
  //如果为空,重新获取
  Access_token = wxs.GetAccessToken();

  //设置缓存的数据7000秒后过期
  Cache.Insert("Access_token", Access_token, null, DateTime.Now.AddSeconds(7000), System.Web.Caching.Cache.NoSlidingExpiration);
  }

  string Access_tokento = Access_token.Substring(17, Access_token.Length - 37);


  string posturl = "https://api.weixin.qq.com/cgi-bin/user/info/updateremark?access_token=" + Access_tokento;

  string postData = "{\"openid\":\"" + openid.ToString().Trim() + "\",\"remark\":\"" + this.txtRemarkName.Value.ToString() + "\"}";


  res = wxs.GetPage(posturl, postData);


  //使用前需药引用Newtonsoft.json.dll文件
  JObject jsOnObj= JObject.Parse(res);

  ///获取返回结果的正确|true|false,
  string isright = jsonObj["errcode"].ToString();//0
  string istrueorfalse = jsonObj["errmsg"].ToString();//ok
  if (isright.Equals("0") && istrueorfalse.Equals("ok"))
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;修改备注成功!&#39;);location=&#39;WeiXinUserList.aspx&#39;;", true);
  }
  else
  {
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "alert(&#39;修改备注失败!&#39;);", true);
  }

 }

以上就是asp.net微信开发已关注用户管理步骤详解的详细内容,更多请关注php中文网其它相关文章!


推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • 使用在线工具jsonschema2pojo根据json生成java对象
    本文介绍了使用在线工具jsonschema2pojo根据json生成java对象的方法。通过该工具,用户只需将json字符串复制到输入框中,即可自动将其转换成java对象。该工具还能解析列表式的json数据,并将嵌套在内层的对象也解析出来。本文以请求github的api为例,展示了使用该工具的步骤和效果。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • 本文介绍了前端人员必须知道的三个问题,即前端都做哪些事、前端都需要哪些技术,以及前端的发展阶段。初级阶段包括HTML、CSS、JavaScript和jQuery的基础知识。进阶阶段涵盖了面向对象编程、响应式设计、Ajax、HTML5等新兴技术。高级阶段包括架构基础、模块化开发、预编译和前沿规范等内容。此外,还介绍了一些后端服务,如Node.js。 ... [详细]
  • 在Android中解析Gson解析json数据是很方便快捷的,可以直接将json数据解析成java对象或者集合。使用Gson解析json成对象时,默认将json里对应字段的值解析到java对象里对应字段的属性里面。然而,当我们自己定义的java对象里的属性名与json里的字段名不一样时,我们可以使用@SerializedName注解来将对象里的属性跟json里字段对应值匹配起来。本文介绍了使用@SerializedName注解解析json数据的方法,并给出了具体的使用示例。 ... [详细]
  • Javascript中带有加号 - 减号(±)的极坐标曲线方程 - Polar curve equation with plus-minus sign (±) in Javascript
    IamtryingtodrawpolarcurvesonHTMLcanvasusingJavascript.WhatshouldIdowhenIwanttoco ... [详细]
  • 本文介绍了如何使用jQuery和AJAX来实现动态更新两个div的方法。通过调用PHP文件并返回JSON字符串,可以将不同的文本分别插入到两个div中,从而实现页面的动态更新。 ... [详细]
  • SpringBoot整合SpringSecurity+JWT实现单点登录
    SpringBoot整合SpringSecurity+JWT实现单点登录,Go语言社区,Golang程序员人脉社 ... [详细]
  • express工程中的json调用方法
    本文介绍了在express工程中如何调用json数据,包括建立app.js文件、创建数据接口以及获取全部数据和typeid为1的数据的方法。 ... [详细]
  • 在C#中,使用关键字abstract来定义抽象类和抽象方法。抽象类是一种不能被实例化的类,它只提供部分实现,但可以被其他类继承并创建实例。抽象类可以用于类、方法、属性、索引器和事件。在一个类声明中使用abstract表示该类倾向于作为其他类的基类成员被标识为抽象,或者被包含在一个抽象类中,必须由其派生类实现。本文介绍了C#中抽象类和抽象方法的基础知识,并提供了一个示例代码。 ... [详细]
  • Unity3D引擎的体系结构和功能详解
    本文详细介绍了Unity3D引擎的体系结构和功能。Unity3D是一个屡获殊荣的工具,用于创建交互式3D应用程序。它由游戏引擎和编辑器组成,支持C#、Boo和JavaScript脚本编程。该引擎涵盖了声音、图形、物理和网络功能等主题。Unity编辑器具有多语言脚本编辑器和预制装配系统等特点。本文还介绍了Unity的许可证情况。Unity基本功能有限的免费,适用于PC、MAC和Web开发。其他平台或完整的功能集需要购买许可证。 ... [详细]
author-avatar
Jack捷L
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有