Код: Выделить всё
public class MyClass
{
// example
private static readonly X509Certificate2 staticCertInstance =
new X509Certificate2("cert.pfx");
// the method can be called from different threads
public void Execute()
{
// use staticCertInstance
}
}
Подробнее здесь: https://stackoverflow.com/questions/676 ... hread-safe
Мобильная версия