WmptWeixin/location.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WMPT.Weixin
{
/// <summary>
/// 地理位置消息
/// </summary>
public class location : BaseNotice
{
/// <summary>
/// 根据xml返回对像
/// </summary>
/// <param name="xml"></param>
/// <returns></returns>
public override BaseNotice LoadXml(string xml)
{
location notice = new location();
//<xml>
//<ToUserName><![CDATA[toUser]]></ToUserName>
//<FromUserName><![CDATA[fromUser]]></FromUserName>
//<CreateTime>1348831860</CreateTime>
//<MsgType><![CDATA[text]]></MsgType>
//<Location_X>23.134521</Location_X>
//<Location_Y>113.358803</Location_Y>
//<Scale>20</Scale>
//<Label><![CDATA[位置信息]]></Label>
//<MsgId>1234567890123456</MsgId>
//</xml>
System.Xml.XmlDocument d = new System.Xml.XmlDocument();
d.LoadXml(xml);
System.Xml.XmlCDataSection n = d.SelectSingleNode("/xml/ToUserName").FirstChild as System.Xml.XmlCDataSection;
System.Xml.XmlNode textdata = d.ChildNodes[0];
notice.ToUserName = n.Value;
n = d.SelectSingleNode("/xml/FromUserName").FirstChild as System.Xml.XmlCDataSection;
notice.FromUserName = n.Value;
//n = d.SelectSingleNode("/xml/CreateTime").FirstChild as System.Xml.XmlCDataSection;
//notice.CreateTime = n.Value;
n = d.SelectSingleNode("/xml/MsgType").FirstChild as System.Xml.XmlCDataSection;
notice.MsgType = n.Value;
//n = d.SelectSingleNode("/xml/MsgId").FirstChild as System.Xml.XmlCDataSection;
//notice.MsgId = n.Value;
textdata = d.SelectSingleNode("/xml/Location_X").FirstChild as System.Xml.XmlNode;
notice.Location_X = textdata.Value;
textdata = d.SelectSingleNode("/xml/Location_Y").FirstChild as System.Xml.XmlNode;
notice.Location_Y = textdata.Value;
textdata = d.SelectSingleNode("/xml/Label").FirstChild as System.Xml.XmlNode;
后面还有 42 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
