C#Firebase从数据库获取时间戳

C#Firebase从数据库获取时间戳,c#,wpf,firebase,timestamp,C#,Wpf,Firebase,Timestamp,我已经用c#创建了一个WPF表单,它可以与firebase一起发送消息。我想向firebase发送一个时间戳请求,然后得到回复。我已导入以下内容 using Firebase.Storage; using FireSharp.Config; using FireSharp.Interfaces; using FireSharp.Response; using System; using System.Collections.Generic; using System.IO; using Syst

我已经用c#创建了一个WPF表单,它可以与firebase一起发送消息。我想向firebase发送一个时间戳请求,然后得到回复。我已导入以下内容

using Firebase.Storage;
using FireSharp.Config;
using FireSharp.Interfaces;
using FireSharp.Response;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows; 
并初始化了以下内容

  static string basePath = Properties.Settings.Default.FirebaseAppUri;
    static string storagePath = Properties.Settings.Default.FirebaseStorage;


    //Setup Firebase path and access rights
    IFirebaseConfig config = new FirebaseConfig
    {
        AuthSecret = Properties.Settings.Default.NormalFireKey,
        BasePath = basePath
    };

    IFirebaseClient client;
我尝试了以下代码

   public async void generateTimeStampAsync()
    {
        FirebaseResponse response = await client.GetTaskAsync($"ServerValue/TIMESTAMP");
        Person  person = response.ResultAs<Person>();
        MessageBox.Show(person.ToString());
    }
}
public async void generateTimeStampAsync()
{
FirebaseResponse=wait client.GetTaskAsync($“ServerValue/TIMESTAMP”);
Person=response.ResultAs();
Show(person.ToString());
}
}

但该程序只接收空值。有没有关于如何在c#中为wpf应用程序执行此操作的建议?

,因为您正在向错误的对象进行强制转换。你要的是时间戳,我不知道确切的类型。我猜是约会时间。但它不会是一个人。如果在等待之后在该行上插入断点。当它被点击时,您的回复中是否有datetime或类似的内容?嗨,抱歉,Person是datetime对象,我只是使用了一个我已经编辑过的现有文件。您如何建议从C#获得firebase的时间戳。如果我能得到正确的答案,我也调查了firestore库,但它的文档记录太差了,我无法解决如何实现它以满足我的需要