Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如您所见,我尝试将 Thread 的 CurrentCulture 捕获到一个实例变量中,以便我可以在整个类中重用它,但它并没有持久化。在上面的照片中,我展示了即使在分配它之后,值仍然不同。为什么是这样?
发生这种情况有几个可能的原因
PickLanguage
其中任何一个都会导致缓存的区域性与当前区域性不同。一般来说,缓存命名的值Current是危险的,因为它表明它们可以并且将会改变
Current