का उपयोग कर app.config वर्गों के डिक्रिप्शन हमारे कार्यक्रम की स्थापना के दौरान हम app.config के वर्गों encrpyt के लिए इस विधि चलाएँ:
एन्क्रिप्शन/RsaProtectedConfigurationProvider
// Get the application configuration file.
Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// Define the Rsa provider name.
const string provider = "RsaProtectedConfigurationProvider";
// Get the section to protect.
ConfigurationSection connStrings = config.ConnectionStrings;
if (connStrings != null)
{
if (!connStrings.SectionInformation.IsProtected)
{
if (!connStrings.ElementInformation.IsLocked)
{
// Protect the section.
connStrings.SectionInformation.ProtectSection(provider);
connStrings.SectionInformation.ForceSave = true;
config.Save(ConfigurationSaveMode.Full);
}
}
}
अब तक ठीक काम करता है। लेकिन अगर मैं इस कार्यक्रम चलाने के लिए, हम कई मशीनों की मुठभेड़ निम्न त्रुटि "प्रदाता 'RsaProtectedConfigurationProvider' प्रदाता से त्रुटि संदेश का उपयोग कर डिक्रिप्ट करने में असफल:। RSA कुंजी कंटेनर खोला नहीं जा सका"।
बेशक मैं खोज की है और this help पाया है, लेकिन यह काम नहीं करता। कोई विचार?
असफल मशीनों पर ओएस क्या है? शायद यह यूएसी + ऊंचाई समस्या हो सकती है। उन मशीनों के बारे में कोई भी जानकारी अच्छी होगी। –
शायद जाने के लिए एक अच्छी दिशा है। वर्तमान में विस्टा, डब्ल्यू 7 और सर्वर 2008 ज्ञात हैं। – Jan