用Environment.Version判断当前的.net版本吧,反正1.1不支持.2.0支持
该类好像是System.Security.Cryptography下的类

解决方案 »

  1.   

    RE:Zine_Alone(☆小飞☆) 我们的项目是用.Net1.1做的,我是想知道在1.1中如何实现“veriSig”这个方法(详细请看我发的帖)
      

  2.   

    安装wse3.0using Microsoft.Web.Services3.Security.X509;
    private X509SecurityToken GetSigningToken()
    {
    // NOTE: If you use the WSE 3.0 sample certificates then
    // you should not need to change these IDs
    string ClientBase64KeyId = "Xt/WZcILstC8oJuMqQcxbokIGR4=";
    X509SecurityToken token = null;
    // Open the CurrentUser Certificate Store
    X509CertificateStore store;
    store = X509CertificateStore.CurrentUserStore( X509CertificateStore.MyStore );
    if ( store.OpenRead() )
    {
    X509CertificateCollection certs = store.FindCertificateByKeyIdentifier( ➥
    Convert.FromBase64String( ClientBase64KeyId ) );
    if (certs.Count > 0)
    {
    // Get the first certificate in the collection
    token = new X509SecurityToken( ((X509Certificate) certs[0]) );
    }
    }
    return token;
    }
      

  3.   

    Re:hanmlxiao(hanml)谢谢你的方法,不过还是希望不安装其它组件实现~
      

  4.   

    http://blog.joycode.com/demonfox/archive/2007/01/23/92487.aspx
    .NET 2.0中对Ceritificate以及Certificate Store的使用和管理提供了很多的类,请参看System.Security.Cryptography.X509Certificates这个命名空间。两个最常用的类是: X509Store (代表Certificate Store)和X509Certificate2 (代表X509标准的Certificates) 
      

  5.   

    Re:mfkdxu(渊渊其渊) 
    对不起,我们的项目是在.Net 1.1下的,所以我希望能找到一个.Net 1.1下的解决方法,谢谢你的热心回复!
      

  6.   

    Re:jimh(Jimmy) 
    我也想,可是这是公司的项目,不是我说了算的啊~
    谢谢你的意见 ^_^
      

  7.   

    从微软的网站上下载一个CAPICOM.dll这个组件.
    微软的msdn英文上有这个组件的详细用法.