X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly );
X509Certificate2Collection certs = X509Certificate2UI.SelectFromCollection(store.Certificates, "MyTitle", "MyMessage", X509SelectionFlag.SingleSelection);
if (1 == certs.Count)
{
Console.WriteLine("您选择了 \"{0}\"",
certs[0].SubjectName.Name);
}
else Console.WriteLine("您取消了我的对话框!");