我需要填充系统证书。当我在 VS 下调试它时,相同的源代码告诉我证书计数正确。当我在IIS 7.5 Windows 7下运行代码时,.Count总是返回0。有没有权限问题?为什么计数返回 0?
System.Security.Cryptography.X509Certificates.X509Store store = new System.Security.Cryptography.X509Certificates.X509Store(System.Security.Cryptography.X509Certificates.StoreName.My);
store.Open(System.Security.Cryptography.X509Certificates.OpenFlags.ReadOnly);
Response.Write("<hr>Certs count: " + store.Certificates.Count.ToString() + "<br>");