我在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());
}
}
但是该程序只接收一个空值。关于如何在WPF应用程序的C#中执行此操作的任何建议?