Total members 11895 |It is currently Sat Dec 21, 2024 5:57 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,

Can anyone help to , I use ASP .Net in my project , I try to encrypt my
connection string in Web.config through OOP, I use this codes to encrypt the
"ConnectionStrings", but when I run the application , it does't work.

In
Class:ImportsMicrosoft.VisualBasicImportsSystem.ConfigurationImportsSystem.Web.C\
onfigurationImports
System.SecurityPublic
ClassEncConStrClassPublicSubEncryptConnStr(ByValprotectionProvider
AsString)''---open the web.config fileDimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")''---indicate the section to
protectDimsection AsConfigurationSection =
config.Sections("connectionStrings")''---specify the protection
providersection.SectionInformation.ProtectSection(protectionProvider)'---Apple
the protection and
updateconfig.Save()EndSubsection.SectionInformation.UnProtectSection()
config.Save()
End

In Form "Behind Code":ProtectedSubPage_Load(ByValsender AsObject, ByVale
AsSystem.EventArgs) HandlesMe.LoadDimX
AsNewEncConStrClass''X.EncryptConnStr("DataProtectionConfigurationProvider")X.En\
cryptConnStr(

N.B:
When I test this codes in form directly , it works & encrypted the
connectionstring
plz help me soon,"RSAProtectedConfigurationProvider")End
SubPublicSubDecryptConnStr()Dimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")Dimsection
AsConfigurationSection = config.Sections("connectionStrings")EndSubClass




Author:
Proficient
User avatar Posts: 280
Have thanks: 1 time

AskBot wrote:
Hi,

Can anyone help to , I use ASP .Net in my project , I try to encrypt my
connection string in Web.config through OOP, I use this codes to encrypt the
"ConnectionStrings", but when I run the application , it does't work.

In
Class:ImportsMicrosoft.VisualBasicImportsSystem.ConfigurationImportsSystem.Web.C\
onfigurationImports
System.SecurityPublic
ClassEncConStrClassPublicSubEncryptConnStr(ByValprotectionProvider
AsString)''---open the web.config fileDimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")''---indicate the section to
protectDimsection AsConfigurationSection =
config.Sections("connectionStrings")''---specify the protection
providersection.SectionInformation.ProtectSection(protectionProvider)'---Apple
the protection and
updateconfig.Save()EndSubsection.SectionInformation.UnProtectSection()
config.Save()
End

In Form "Behind Code":ProtectedSubPage_Load(ByValsender AsObject, ByVale
AsSystem.EventArgs) HandlesMe.LoadDimX
AsNewEncConStrClass''X.EncryptConnStr("DataProtectionConfigurationProvider")X.En\
cryptConnStr(

N.B:
When I test this codes in form directly , it works & encrypted the
connectionstring
plz help me soon,"RSAProtectedConfigurationProvider")End
SubPublicSubDecryptConnStr()Dimconfig AsConfiguration =
WebConfigurationManager.OpenWebConfiguration("")Dimsection
AsConfigurationSection = config.Sections("connectionStrings")EndSubClass



Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : Encrypt connection string
 how to encrypt password in jsp     -  
 check if string ends with specific sub-string in php     -  
 check if string start with a specific sub-string in PHP     -  
 recursive string reversal- reverse string     -  
 Splitting a String Based on a Found String     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 String token for string split     -  
 Connection object in jsp     -  
 Closing connection in jsp     -  
 How to use connection object in jsp     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com