c# - C# Firebase 从数据库中获取时间戳
问题描述
我在 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());
}
}
但是程序只是收到一个空值。关于如何在 c# 中为 wpf 应用程序执行此操作的任何建议?
解决方案
推荐阅读
- reactjs - React Navigation 丢失了传递下来的道具
- python-2.7 - 如何将带有元组键和整数值的字典写入文件?
- android-studio - 如何在Android中居中水平文本视图
- regex - 浮点数列表的正则表达式
- r - 为什么在使用带有 mode = 'draw' 的 mapedit::selectFeatures 时会出现错误?
- bro - Bro: Disable reading and writing of .state/state.bst
- angular - Route issue with deploying Angular 5 on Tomcat
- c# - 找不到 txt 文件 StreamReader
- java - 在 Eclipse IDE 中工作,应该等于不等于的值
- firebase - Firebase Caching with AMP