Это вроде не вопрос, но нужно уточнить. Вот код Все, что делает этот код, это отправка отправки файла cer на сервер в httpwebrequest, который находится на локальном диске. Мой вопрос: что произойдет, если несколько пользователей попытаются получить доступ к приложению одновременно. Я имею в виду 5-10 запросов, читающих один и тот же сертификат одновременно. сломается ли сообщение о том, что файл cer заблокирован каким-либо другим потоком для чтения / или он не прервется, потому что он только для чтения?
//You must change the path to point to your .cer file location.
X509Certificate Cert = X509Certificate.CreateFromCertFile("C:\\mycert.cer");
// Handle any certificate errors on the certificate from the server.
ServicePointManager.CertificatePolicy = new CertPolicy();
// You must change the URL to point to your Web server.
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://YourServer/sample.asp");
Request.ClientCertificates.Add(Cert);
Request.UserAgent = "Client Cert Sample";
Request.Method = "GET";
HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();
// Print the repsonse headers.
Console.WriteLine("{0}",Response.Headers);
Console.WriteLine();
// Get the certificate data.
StreamReader sr = new StreamReader(Response.GetResponseStream(), Encoding.Default);
int count;
char [] ReadBuf = new char[1024];
do
{
count = sr.Read(ReadBuf, 0, 1024);
if (0 != count)
{
Console.WriteLine(new string(ReadBuf));
}
}while(count > 0);