A useful article about using Regex.Replace
Using Replacement Strings with Regex.Replace
12 years ago
One step forward, two steps back
string[] recordIds = { "q", "z", "a", "b", "q" };
Array.Sort(recordIds);
string[] recordIds = { "q", "z", "a", "b", "q" };
var sortedUniqueIds = (from id in recordIds orderby id select id).Distinct();
int i=0;
foreach (string id in sortedUniqueIds)
{
recordIds[i++] = id;
}
Dictionary<string, string> dict = new Dictionary<string, string>();
...
// Sort by Key
var keys = from key in dict.Keys orderby key ascending select key;
// Sort by Value
var keys = from key in dict.Keys orderby dict[key] ascending select key;
// Sort within foreach(...) by Key
foreach(string aKey in (from key in dict.Keys orderby key ascending select key)){
...
}
<serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
so I'll need to tweak those values somehow and right now on the client to avoid the "trusted certificate" issue, I needed :<serviceCertificate>
<!--
Setting the certificateValidationMode to PeerOrChainTrust means that if the certificate
is in the user's Trusted People store, then it will be trusted without performing a
validation of the certificate's issuer chain. This setting is used here for convenience so that the
sample can be run without having to have certificates issued by a certificate authority (CA).
This setting is less secure than the default, ChainTrust. The security implications of this
setting should be carefully considered before using PeerOrChainTrust in production code.
-->
<authentication certificateValidationMode="PeerOrChainTrust" />
</serviceCertificate>
Certificate Validation Differences Between HTTPS, SSL over TCP, and SOAP SecurityServicePointManager.ServerCertificateValidationCallback +=
new RemoteCertificateValidationCallback(ValidateServerCertificate);
where the signature for ValidateServerCertificate is as follows:public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)