Here is a method that can work, should in theory also be able to add numbers in string with chars.
string s = "1234";
int total = 0;
foreach (char c in s)
{
int x;
int.TryParse(c.ToString(), out x);
total += x;
}
Here is a method that can work, should in theory also be able to add numbers in string with chars.
string s = "1234";
int total = 0;
foreach (char c in s)
{
int x;
int.TryParse(c.ToString(), out x);
total += x;
}
Hi, I have created a certificate both private and public key (created using MS SQL Server, and Visual Studio Tools), which I have imported into the Certificate Store under Trusted People, Machine Level. I have a program that encrypts sensitive data on that server, using the private/public key. I kan run the same program to decrypt data encrypted on the same machine, but when I run the program on another computer (using the same private key, in this case the pfk file) I'm getting error when I run decryption. I also discovered that when I use the certificate store certificate to encrypt, and load the pfk file into my program to use that private key to decrypt the same data I fail to decrypt it. I'm using .net X509Certificate lib, with RSA provider and CSParameters, on Windows Platform, both XP and windows server 2003. I have read some worring comments that using certificate store to encrypt data, you have to decrypt this data using the same machine. Would this be the case, I'm not able to find any threads on the internet about this issue. If there is an issue with encryption/decryption across machines using the certificate store facilities, which method would you recommend to ensure decryptablilty across machines? I'm writing the code in C#, but it could be any managed code in .net. Hope some here have some fact and tips in this case. Thanks,