如何在Silverlight中获取日期时间? [英] how to get datetime in silverlight?
问题描述
从标题来看,这似乎是一个愚蠢的问题:)我知道,但是我有一个Silverlight应用程序,需要将日期时间发送到3rdparty Web方法,并基于日期时间填充一些客户端控件...现在我知道如何从日期控件客户,但问题是客户时间可能是错误的........ 一种方法是使用Web服务获取日期时间还有其他想法吗?
from title it appears a stupid question :) i know but i have a silverlight application that needs to send datetime to a 3rdparty web method and based on datetime populate some client side controls... now i know how to get datetime from client but problem is that client time could be wrong........ one method is to use a webservice to get datetime any other idea?
推荐答案
如果您需要服务器时间的可靠性,那么可以-一个Web服务就足够了.最近,我遇到了Silverlight的局限性,只有Web服务(WCF或其他方式)才能解决.我为自己的方案选择了一个普通的.NET Web服务,当一切都说完并完成后,它就像一个魅力.
If you need the reliability of the server's time, then yeah -- a web service would suffice. I ran into a limitation with Silverlight recently that only a web service (WCF or otherwise) would solve. I chose an ordinary .NET web service for my scenario and when it was all said and done it worked like a charm.
这篇关于如何在Silverlight中获取日期时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!