这应该怎么做呢? (返回值的集合)
我正在编写一个天气 API,以使用 C# NETMF 连接到 NOAA 的 XML METARS。之前,这个 API 是用 PHP 编写的,我可以使用关联数组来返回天气参数。例如,getWX()
函数的返回可能是
Array(
"temp_f" => "70.0",
"windchil" => "65.0",
"wind_dir" => "90"
);
我试图在我的 CSharp 版本中复制相同的功能,但我不确定如何去做。由于我使用 NETMF,因此无法使用哈希表。
我应该使用结构体吗?
如果有人想查看原始 PHP API 背后的代码,请访问:http:// /www.chrisseto.com/wordpress/?p=17 我试图让 CSharp 版本尽可能相似。
谢谢!
I am writing a weather API to connect to the NOAA's XML METARS in C# NETMF. Before, this API was written in PHP, where I was able to use an associative array to return the weather parameters. For example, the return of the getWX()
function might have been
Array(
"temp_f" => "70.0",
"windchil" => "65.0",
"wind_dir" => "90"
);
I am trying to replicate that same functionality in my CSharp version, but I am not sure how to go about doing it. Since I am using NETMF, I cannot use a hashtable.
Should I use a struct instead?
In case anyone wants to see the code behind the original PHP API, it is here: http://www.chrisseto.com/wordpress/?p=17
I am trying to get the CSharp version to be as similar as possible.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论