问题。如何在using System;
using System.IO;
using System.Xml.Serialization;
[XmlRoot(ElementName = "result")]
public class Result
{
[XmlElement(ElementName = "fwdRate")]
public double FwdRate { get; set; }
}
public class Program
{
public static void Main()
{
string val = "<result><fwdRate>-9.72316862724032E-05</fwdRate></result>";
Result response = ParseXML(val);
Console.WriteLine(response.FwdRate);
}
static Result ParseXML(string value)
{
XmlSerializer serializer = new XmlSerializer(typeof(Result));
using (TextReader reader = new StringReader(value))
{
return serializer.Deserialize(reader) as Result;
}
}
}
下的数据顺序上获取数据? vpk1lxv7ZHY7KbOJ4l5Bl4KOBKJ3 和double
> 08-11-karpetyogadwisaputra08213838686868yogadwisaputra1-27 吗?
decimal
我这样尝试,但数据始终为空。请帮助
(我从 datauser 获得了用户ID 和 idorder )
更新 请求的 idorder 输出
userId
使用数据用户 上的idorder
来 idorder 的screnshot输出
答案 0 :(得分:0)
尝试一下,这就是我的工作方式
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
dataOrder dataorder = dataSnapshot.getValue(dataOrder.class);
if (dataorder != null) {
status.setText("jadwal anda= "+ dataorder.haritanggalOrder + ".....");
}