protected void Page_Load(object sender, EventArgs e) { Wx Wx = new Wx(); string AccessToken = Wx.AccessToken.Get; WxUserList WxUserList = Wx.User.GetUserList(AccessToken); for (int i = 0; i < WxUserList.data.openid.Count; i++) { string kk = WxUserList.data.openid[i]; } foreach (string kc in WxUserList.data.openid) { string k4c = kc; } //Wx.User.GetUserList(AccessToken, "oXQwCt60GWPKmymy6LufFhERyGsY"); //dynamic Obj=Wx.Http.PostGetObj(UserList); //dynamic openids= Obj.data.openid; ////List<string> kc = (List<string>)openids; //string kc = openids[0].ToString(); //foreach(string kc3 in openids){ // string k3 = kc3; //} //dynamic kk = new object(); //kk.g = "123"; // Wx.User.GetUserList(Config,); }
public WxUserList GetUserList(string AccessToken, string Next_Openid = "") { try { WxUserList UserList = new WxUserList(); Url Url = new Url("https://api.weixin.qq.com/cgi-bin/user/get"); Url.Head("?"); Url.Body("access_token", AccessToken); Url.Body("next_openid", Next_Openid); string ResultStr = Http.Post(Url.ToString()); return(JsonConvert.DeserializeObject <WxUserList>(ResultStr)); } catch (WxException WxEx) { throw WxEx; } catch (Exception ex) { throw new Exception("Wx.User.GetUserList:获取用户列表出错", ex); } }