我试图打上资源档案,我把这一档案藏在资源中。 这是一份证书。 简言之,我试图打电话,然后才能安装证书;没有用户必须下载档案。 这里是我手法:
public static void TESTNEWINSTALL()
{
string myString = System.Text.Encoding.UTF8.GetString(Properties.Resources.FiddlerRoot);
X509Store store = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadWrite);
store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(myString)));
store.Close();
MessageBox.Show("Done");
}
The Embedded Resource is called FiddlerRoot but it s actually a file named FiddlerRoot.cer. However I am getting an error code: Illegal characters in path on the line: store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(myString)));
我也附上了一张照片供作进一步解释。 我在这里做了什么错误?