4

組織内の各 PC から特定の証明書を削除できるようにする必要があります。はい、席から席へ行くこともできますが、木曜日までにそれをやってのける必要があり、席から席へ行く人手がありません。

C# を使用してこれを行うプログラム的な方法はありますか?

4

2 に答える 2

3

C# をクランクアウトする必要はないと思います - を見てくださいcertmgr.exe /del

これを行うために今日本当にC# を書きたい場合は、 をご覧くださいX509Store.Remove

于 2009-03-16T21:32:07.690 に答える
3

MSDN に例があります (ここをクリック)

例は一目瞭然だと思いますが、抜粋は次のとおりです。

using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.IO;

public class X509store2
{
    public static void Main (string[] args)
    {
        //Create new X509 store called teststore from the local certificate store.
        X509Store store = new X509Store ("ROOT", StoreLocation.CurrentUser);
        store.Open (OpenFlags.ReadWrite);

        ...

        store.Remove (certificate1);
        store.RemoveRange (collection);

        ...

        //Close the store.
        store.Close ();
    }    
}
于 2009-03-16T22:30:23.197 に答える